Documentation
¶
Overview ¶
Package okta is the Okta API client. It authenticates with OAuth 2.0 private key JWTs and reads groups and their members' GitHub usernames.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultScopes = []string{"okta.groups.read", "okta.users.read"}
DefaultScopes are the OAuth scopes group sync needs.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reads Okta groups and members. Implements domain.OktaClient.
func (*Client) GetGroupInfo ¶
GetGroupInfo fetches a single Okta group by its exact name, with its members.
func (*Client) GetGroupsByPattern ¶
func (c *Client) GetGroupsByPattern(ctx context.Context, pattern string) ([]*domain.GroupInfo, error)
GetGroupsByPattern fetches every Okta group whose name matches pattern, with its members. A group whose members can't be fetched is returned with Err set, so the caller can report it without syncing it.
type Options ¶ added in v1.0.0
type Options struct {
// Domain is the Okta org's host, such as example.okta.com.
Domain string
ClientID string
// PrivateKey is the PEM-encoded RSA key registered with the OAuth app.
PrivateKey []byte
PrivateKeyID string
Scopes []string
// GitHubUserField is the user profile attribute holding the GitHub
// username.
GitHubUserField string
// BaseURL overrides https://<Domain>, for tests.
BaseURL string
// HTTPClient is the client requests are sent with, for tests.
HTTPClient *http.Client
}
Options configures a Client.