okta

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 New added in v1.0.0

func New(opts Options) (*Client, error)

New creates a Client. It makes no API calls.

func (*Client) GetGroupInfo

func (c *Client) GetGroupInfo(ctx context.Context, name string) (*domain.GroupInfo, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL