auth0

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package auth0 contains the Auth0 directory provider. Note that Auth0 refers to groups as roles.

Index

Constants

View Source
const Name = "auth0"

Name is the provider name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(cfg *config)

Option provides config for the Auth0 Provider.

func WithDomain

func WithDomain(domain string) Option

WithDomain sets the provider domain option.

func WithServiceAccount

func WithServiceAccount(serviceAccount *ServiceAccount) Option

WithServiceAccount sets the service account option.

type Provider

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

Provider is an Auth0 user group directory provider.

func New

func New(options ...Option) *Provider

New creates a new Provider.

func (*Provider) User

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

User returns the user record for the given id.

func (*Provider) UserGroups

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

UserGroups fetches a slice of groups and users.

type RoleManager

type RoleManager interface {
	List(opts ...management.RequestOption) (r *management.RoleList, err error)
	Users(id string, opts ...management.RequestOption) (u *management.UserList, err error)
}

RoleManager defines what is needed to get role info from Auth0.

type ServiceAccount

type ServiceAccount struct {
	ClientID string `json:"client_id"`
	Secret   string `json:"secret"`
}

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

func ParseServiceAccount

func ParseServiceAccount(options directory.Options) (*ServiceAccount, error)

ParseServiceAccount parses the service account in the config options.

type UserManager

type UserManager interface {
	Read(id string, opts ...management.RequestOption) (*management.User, error)
	Roles(id string, opts ...management.RequestOption) (r *management.RoleList, err error)
}

UserManager defines what is needed to get user info from Auth0.

Directories

Path Synopsis
Package mock_auth0 is a generated GoMock package.
Package mock_auth0 is a generated GoMock package.

Jump to

Keyboard shortcuts

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