Skip to content

Commit

Permalink
Merge pull request #10 from ConductorOne/mchavez-baton-vgs-v2
Browse files Browse the repository at this point in the history
Fix capabilities
  • Loading branch information
ggreer authored May 10, 2024
2 parents de0153a + 4e2b777 commit 59dda6b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 10 deletions.
51 changes: 44 additions & 7 deletions baton_capabilities.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
{
"@type": "type.googleapis.com/c1.connector.v2.ConnectorCapabilities",
"resourceTypeCapabilities": [
"@type": "type.googleapis.com/c1.connector.v2.ConnectorCapabilities",
"resourceTypeCapabilities": [
{
"resourceType": {
"id": "user",
"displayName": "User",
"traits": [
"resourceType": {
"id": "org",
"displayName": "Org",
"annotations": [
{
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
"id": "org"
}
]
},
"capabilities": [
"CAPABILITY_SYNC",
"CAPABILITY_PROVISION"
]
},
{
"resourceType": {
"id": "user",
"displayName": "User",
"traits": [
"TRAIT_USER"
],
"annotations": [
{
"@type": "type.googleapis.com/c1.connector.v2.SkipEntitlementsAndGrants"
}
]
},
"capabilities": [
"capabilities": [
"CAPABILITY_SYNC"
]
},
{
"resourceType": {
"id": "vault",
"displayName": "Vault",
"annotations": [
{
"@type": "type.googleapis.com/c1.connector.v2.V1Identifier",
"id": "vault"
}
]
},
"capabilities": [
"CAPABILITY_SYNC",
"CAPABILITY_PROVISION"
]
}
]
}
12 changes: 9 additions & 3 deletions pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ func (d *Connector) Validate(ctx context.Context) (annotations.Annotations, erro

// New returns a new instance of the connector.
func New(ctx context.Context, clientId, clientSecret, organizationId, vaultId string) (*Connector, error) {
vc, err := client.New(ctx, clientId, clientSecret, organizationId, vaultId)
if err != nil {
return nil, err
var (
vc *client.VGSClient
err error
)
if clientId != "" && clientSecret != "" {
vc, err = client.New(ctx, clientId, clientSecret, organizationId, vaultId)
if err != nil {
return nil, err
}
}

return &Connector{
Expand Down

0 comments on commit 59dda6b

Please sign in to comment.