Skip to content

Commit 914a901

Browse files
committed
fix conflicts
2 parents 32500bb + 873d883 commit 914a901

File tree

11 files changed

+865
-39
lines changed

11 files changed

+865
-39
lines changed

baton_capabilities.json

Lines changed: 53 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,98 @@
11
{
2-
"@type": "type.googleapis.com/c1.connector.v2.ConnectorCapabilities",
3-
"resourceTypeCapabilities": [
2+
"@type": "type.googleapis.com/c1.connector.v2.ConnectorCapabilities",
3+
"resourceTypeCapabilities": [
44
{
5-
"resourceType": {
6-
"id": "org",
7-
"displayName": "Org",
8-
"annotations": [
5+
"resourceType": {
6+
"id": "org",
7+
"displayName": "Org",
8+
"annotations": [
99
{
10-
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
11-
"id": "org"
10+
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
11+
"id": "org"
1212
}
1313
]
1414
},
15-
"capabilities": [
15+
"capabilities": [
1616
"CAPABILITY_SYNC",
1717
"CAPABILITY_PROVISION"
1818
]
1919
},
2020
{
21-
"resourceType": {
22-
"id": "repository",
23-
"displayName": "Repository",
24-
"annotations": [
21+
"resourceType": {
22+
"id": "org_role",
23+
"displayName": "Organization Role",
24+
"traits": [
25+
"TRAIT_ROLE"
26+
],
27+
"annotations": [
28+
{
29+
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
30+
"id": "org_role"
31+
}
32+
]
33+
},
34+
"capabilities": [
35+
"CAPABILITY_SYNC",
36+
"CAPABILITY_PROVISION"
37+
]
38+
},
39+
{
40+
"resourceType": {
41+
"id": "repository",
42+
"displayName": "Repository",
43+
"annotations": [
2544
{
26-
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
27-
"id": "repository"
45+
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
46+
"id": "repository"
2847
}
2948
]
3049
},
31-
"capabilities": [
50+
"capabilities": [
3251
"CAPABILITY_SYNC",
3352
"CAPABILITY_PROVISION"
3453
]
3554
},
3655
{
37-
"resourceType": {
38-
"id": "team",
39-
"displayName": "Team",
40-
"traits": [
56+
"resourceType": {
57+
"id": "team",
58+
"displayName": "Team",
59+
"traits": [
4160
"TRAIT_GROUP"
4261
],
43-
"annotations": [
62+
"annotations": [
4463
{
45-
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
46-
"id": "team"
64+
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
65+
"id": "team"
4766
}
4867
]
4968
},
50-
"capabilities": [
69+
"capabilities": [
5170
"CAPABILITY_SYNC",
5271
"CAPABILITY_PROVISION"
5372
]
5473
},
5574
{
56-
"resourceType": {
57-
"id": "user",
58-
"displayName": "User",
59-
"traits": [
75+
"resourceType": {
76+
"id": "user",
77+
"displayName": "User",
78+
"traits": [
6079
"TRAIT_USER"
6180
],
62-
"annotations": [
81+
"annotations": [
6382
{
64-
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
65-
"id": "user"
83+
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
84+
"id": "user"
6685
}
6786
]
6887
},
69-
"capabilities": [
88+
"capabilities": [
7089
"CAPABILITY_SYNC"
7190
]
7291
}
7392
],
74-
"connectorCapabilities": [
93+
"connectorCapabilities": [
7594
"CAPABILITY_PROVISION",
7695
"CAPABILITY_SYNC"
7796
],
78-
"credentialDetails": {}
97+
"credentialDetails": {}
7998
}

pkg/connector/connector.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ var (
5555
Traits: []v2.ResourceType_Trait{v2.ResourceType_TRAIT_SECRET},
5656
Annotations: annotations.New(&v2.SkipEntitlementsAndGrants{}),
5757
}
58+
resourceTypeOrgRole = &v2.ResourceType{
59+
Id: "org_role",
60+
DisplayName: "Organization Role",
61+
Traits: []v2.ResourceType_Trait{v2.ResourceType_TRAIT_ROLE},
62+
Annotations: v1AnnotationsForResourceType("org_role"),
63+
}
5864
)
5965

6066
type GitHub struct {
@@ -73,6 +79,7 @@ func (gh *GitHub) ResourceSyncers(ctx context.Context) []connectorbuilder.Resour
7379
teamBuilder(gh.client, gh.orgCache),
7480
userBuilder(gh.client, gh.hasSAMLEnabled, gh.graphqlClient, gh.orgCache),
7581
repositoryBuilder(gh.client, gh.orgCache),
82+
orgRoleBuilder(gh.client, gh.orgCache),
7683
}
7784

7885
if gh.syncSecrets {

pkg/connector/org.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func organizationResource(
5050
&v2.ChildResourceType{ResourceTypeId: resourceTypeUser.Id},
5151
&v2.ChildResourceType{ResourceTypeId: resourceTypeTeam.Id},
5252
&v2.ChildResourceType{ResourceTypeId: resourceTypeRepository.Id},
53+
&v2.ChildResourceType{ResourceTypeId: resourceTypeOrgRole.Id},
5354
}
5455
if syncSecrets {
5556
annotations = append(annotations, &v2.ChildResourceType{ResourceTypeId: resourceTypeApiToken.Id})

0 commit comments

Comments
 (0)