Skip to content

Commit

Permalink
Add possibility to use auth0 token to connect to tenant service
Browse files Browse the repository at this point in the history
  • Loading branch information
carabasdaniel committed Jul 27, 2023
1 parent 895b41c commit a6659e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkg/cli/clients/aserto_tenant_connection_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
type TenantConfig struct {
Address string
APIKey string
Token string
TenantID string
Insecure bool
}
Expand All @@ -25,6 +26,9 @@ func NewTenantConnectionClient(c *cc.CommonCtx, cfg *TenantConfig) (connection.C
grpcClient.WithInsecure(cfg.Insecure),
}

if cfg.Token != "" {
opts = append(opts, grpcClient.WithTokenAuth(cfg.Token))
}
if cfg.APIKey != "" {
opts = append(opts, grpcClient.WithAPIKeyAuth(cfg.APIKey))
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/cli/cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ type ConfigureCmd struct {
EdgeAuthorizer bool `short:"e" help:"configure topaz to work as an edge authorizer connected to the aserto control plane" default:"false"`
TenantAddress string `help:"aserto tenant service address" default:"tenant.prod.aserto.com:8443"`
TenantID string `help:"your aserto tenant id"`
TenantKey string `help:"API key to connect to the tenant service"`
TenantAPIKey string `help:"root API key to connect to the tenant service"`
TenantToken string `help:"token to connect to the tenant service"`
ConnectionID string `help:"edge authorizer connection id"`
DiscoveryURL string `help:"discovery service url" default:"https://discovery.prod.aserto.com/api/v2/discovery"`
DiscoveryKey string `help:"discovery service api key"`
Expand Down Expand Up @@ -69,7 +70,8 @@ func (cmd ConfigureCmd) Run(c *cc.CommonCtx) error {

clientConfig := clients.TenantConfig{
Address: cmd.TenantAddress,
APIKey: cmd.TenantKey,
Token: cmd.TenantToken,
APIKey: cmd.TenantAPIKey,
TenantID: cmd.TenantID,
Insecure: true,
}
Expand Down

0 comments on commit a6659e2

Please sign in to comment.