Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUserNotFound = errors.New("user not found")
ErrUserNotFound is returned when a user is not present in Okta.
Functions ¶
This section is empty.
Types ¶
type BoocsekAttributes ¶ added in v1.12.0
type BoocsekAttributes struct { Site string `json:"site"` Position string `json:"position"` Channel string `json:"channel"` Tier string `json:"tier"` Team string `json:"team"` TeamManager string `json:"teamManager"` Staff string `json:"staff"` State string `json:"state"` KiwibaseID int32 `json:"kiwibaseId"` Substate string `json:"substate"` Skills []string `json:"skills"` }
BoocsekAttributes contains formatted Boocsek attributes provided by Okta.
type Cacher ¶
type Cacher interface { Get(key string, value interface{}) error Set(key string, value interface{}, ttl time.Duration) error Del(key string) error MSet(pairs map[string]interface{}, ttl time.Duration) error }
Cacher contains methods needed from a cache.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represent an Okta client.
func NewClient ¶
func NewClient(opts *ClientOpts) *Client
NewClient creates an Okta client based on the given options.
func (*Client) AddPermissions ¶
AddPermissions adds Okta groups to the given user object.
func (*Client) GetUser ¶
GetUser returns an Okta user by email. It first tries to get it from cache, and if not present there, it will fetch it from Okta API.
func (*Client) SyncGroups ¶
func (c *Client) SyncGroups()
SyncGroups gets all groups from Okta and saves them into cache.
type ClientOpts ¶
type ClientOpts struct { Cache Cacher LockManager *storage.LockManager BaseURL string AuthToken string IAMConfig *cfg.ServiceConfig Metrics *monitoring.Metrics CustomFetcher func(userAgent string, metrics *monitoring.Metrics) Fetcher }
ClientOpts contains options to create an Okta client.
type Group ¶
type Group struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` LastMembershipUpdated time.Time `json:"lastMembershipUpdated"` }
Group represents an Okta group.
type GroupMembership ¶
GroupMembership holds the current user ids for users who are part of a given group.
type Response ¶
Response for an HTTP request, exposes a JSON method to get the retrieved data.
type User ¶
type User struct { OktaID string `json:"oktaId,omitempty"` // Exported to be cache-able EmployeeNumber string `json:"employeeNumber"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Position string `json:"position"` Department string `json:"department"` Email string `json:"email"` Location string `json:"location"` IsVendor bool `json:"isVendor"` TeamMembership []string `json:"teamMembership"` // Deprecated OrganizationStructure string `json:"orgStructure"` GroupMembership []Group `json:"groupMembership,omitempty"` Manager string `json:"manager"` Permissions []string `json:"permissions"` BoocsekAttributes BoocsekAttributes `json:"boocsek"` }
User contains formatted user data provided by Okta.