Skip to content

Commit

Permalink
Add Account Provisioning related capabilities (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebesimon authored Nov 7, 2024
1 parent 9bcd6a7 commit 060a1a7
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 31 deletions.
82 changes: 51 additions & 31 deletions pb/c1/connector/v2/connector.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions pkg/connectorbuilder/connectorbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,21 @@ func getCapabilities(ctx context.Context, b *builderImpl) *v2.ConnectorCapabilit
resourceTypeCapability.Capabilities = append(resourceTypeCapability.Capabilities, v2.Capability_CAPABILITY_PROVISION)
connectorCaps[v2.Capability_CAPABILITY_PROVISION] = struct{}{}
}
if _, ok := rb.(AccountManager); ok {
resourceTypeCapability.Capabilities = append(resourceTypeCapability.Capabilities, v2.Capability_CAPABILITY_ACCOUNT_PROVISIONING)
connectorCaps[v2.Capability_CAPABILITY_ACCOUNT_PROVISIONING] = struct{}{}
}

if _, ok := rb.(CredentialManager); ok {
resourceTypeCapability.Capabilities = append(resourceTypeCapability.Capabilities, v2.Capability_CAPABILITY_CREDENTIAL_ROTATION)
connectorCaps[v2.Capability_CAPABILITY_CREDENTIAL_ROTATION] = struct{}{}
}

if _, ok := rb.(ResourceManager); ok {
resourceTypeCapability.Capabilities = append(resourceTypeCapability.Capabilities, v2.Capability_CAPABILITY_RESOURCE_CREATE, v2.Capability_CAPABILITY_RESOURCE_DELETE)
connectorCaps[v2.Capability_CAPABILITY_RESOURCE_CREATE] = struct{}{}
connectorCaps[v2.Capability_CAPABILITY_RESOURCE_DELETE] = struct{}{}
}
resourceTypeCapabilities = append(resourceTypeCapabilities, resourceTypeCapability)
}
sort.Slice(resourceTypeCapabilities, func(i, j int) bool {
Expand Down
4 changes: 4 additions & 0 deletions proto/c1/connector/v2/connector.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ enum Capability {
CAPABILITY_SYNC = 2;
CAPABILITY_EVENT_FEED = 3;
CAPABILITY_TICKETING = 4;
CAPABILITY_ACCOUNT_PROVISIONING = 5;
CAPABILITY_CREDENTIAL_ROTATION = 6;
CAPABILITY_RESOURCE_CREATE = 7;
CAPABILITY_RESOURCE_DELETE = 8;
}

message ConnectorCapabilities {
Expand Down

0 comments on commit 060a1a7

Please sign in to comment.