azure

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package azure contains an azure active directory directory provider.

Index

Constants

View Source
const Name = "azure"

Name is the provider name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config)

An Option updates the provider configuration.

func WithGraphURL

func WithGraphURL(graphURL *url.URL) Option

WithGraphURL sets the graph URL for the configuration.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets the http client to use for requests to the Azure APIs.

func WithLoginURL

func WithLoginURL(loginURL *url.URL) Option

WithLoginURL sets the login URL for the configuration.

func WithServiceAccount

func WithServiceAccount(serviceAccount *ServiceAccount) Option

WithServiceAccount sets the service account to use to access Azure.

type Provider

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

A Provider is a directory implementation using azure active directory.

func New

func New(options ...Option) *Provider

New creates a new Provider.

func (*Provider) User added in v0.11.0

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 returns the directory users in azure active directory.

type ServiceAccount

type ServiceAccount struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	DirectoryID  string `json:"directory_id"`
}

A ServiceAccount is used by the Azure provider to query the Microsoft Graph API.

func ParseServiceAccount

func ParseServiceAccount(options directory.Options) (*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