Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3558,6 +3558,14 @@ func (c *Client) DeleteLoginRule(ctx context.Context, name string) error {
return trail.FromGRPC(err)
}

// OktaClient returns an Okta client.
// Clients connecting older Teleport versions still get an okta client when
// calling this method, but all RPCs will return "not implemented" errors (as per
// the default gRPC behavior).
func (c *Client) OktaClient() *okta.Client {
return okta.NewClient(oktapb.NewOktaServiceClient(c.conn))
}

// GetCertAuthority retrieves a CA by type and domain.
func (c *Client) GetCertAuthority(ctx context.Context, id types.CertAuthID, loadKeys bool) (types.CertAuthority, error) {
ca, err := c.TrustClient().GetCertAuthority(ctx, &trustpb.GetCertAuthorityRequest{
Expand Down
10 changes: 1 addition & 9 deletions lib/auth/clt.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ type Client struct {
*APIClient
// HTTPClient is used to make http requests to the server
*HTTPClient
// oktaClient is used to make Okta resoruce requests to the server.
oktaClient services.Okta
}

// Make sure Client implements all the necessary methods.
Expand Down Expand Up @@ -125,15 +123,9 @@ func NewClient(cfg client.Config, params ...roundtrip.ClientParam) (*Client, err
return nil, trace.Wrap(err)
}

oktaClient, err := client.NewOktaClient(cfg.Context, cfg)
if err != nil {
return nil, trace.Wrap(err)
}

return &Client{
APIClient: apiClient,
HTTPClient: httpClient,
oktaClient: oktaClient,
}, nil
}

Expand Down Expand Up @@ -472,7 +464,7 @@ func (c *Client) ListReleases(ctx context.Context) ([]*types.Release, error) {
}

func (c *Client) OktaClient() services.Okta {
return c.oktaClient
return c.APIClient.OktaClient()
}

// WebService implements features used by Web UI clients
Expand Down