ping

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package ping implements a directory provider for Ping.

Index

Constants

View Source
const Name = "ping"

Name is the name of the Ping provider.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config)

An Option updates the Ping configuration.

func WithAPIURL

func WithAPIURL(apiURL *url.URL) Option

WithAPIURL sets the api url in the config.

func WithAuthURL

func WithAuthURL(authURL *url.URL) Option

WithAuthURL sets the auth url in the config.

func WithEnvironmentID

func WithEnvironmentID(environmentID string) Option

WithEnvironmentID sets the environment ID in the config.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets the http client option.

func WithProviderURL

func WithProviderURL(providerURL *url.URL) Option

WithProviderURL sets the environment ID from the provider URL set in the config.

func WithServiceAccount

func WithServiceAccount(serviceAccount *ServiceAccount) Option

WithServiceAccount sets the service account in the config.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements a directory provider using the Ping API.

func New

func New(options ...Option) *Provider

New creates a new Ping Provider.

func (*Provider) User

func (p *Provider) User(ctx context.Context, userID, accessToken string) (*directory.User, error)

User returns a user's directory information.

func (*Provider) UserGroups

func (p *Provider) UserGroups(ctx context.Context) ([]*directory.Group, []*directory.User, error)

UserGroups returns all the users and groups in the directory.

type ServiceAccount

type ServiceAccount struct {
	ClientID      string `json:"client_id"`
	ClientSecret  string `json:"client_secret"`
	EnvironmentID string `json:"environment_id"`
}

A ServiceAccount is used by the Ping provider to query the API.

func ParseServiceAccount

func ParseServiceAccount(rawServiceAccount string) (*ServiceAccount, error)

ParseServiceAccount parses the service account in the config options.

Jump to

Keyboard shortcuts

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