ad

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ADAuthorityHost = "https://login.microsoftonline.com"
View Source
const MSGraphBaseURL = "https://graph.microsoft.com/v1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type ADErr

type ADErr struct {
	Error struct {
		Code       string `json:"code"`
		Message    string `json:"message"`
		InnerError struct {
			Date            string `json:"date"`
			RequestID       string `json:"request-id"`
			ClientRequestID string `json:"client-request-id"`
		} `json:"innerError"`
	} `json:"error"`
}

type AddUser

type AddUser struct {
	Key string `json:"@odata.id"`
}

type Args

type Args struct {
	GroupID string `json:"groupId"`
}

type AzureGroup

type AzureGroup struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	DisplayName string `json:"displayName"`
}

type AzureUser

type AzureUser struct {
	GivenName string `json:"givenName"`
	Mail      string `json:"mail"`
	Surname   string `json:"surname"`
	ID        string `json:"id"`
}

type CreateADGroup

type CreateADGroup struct {
	Description     string   `json:"description"`
	DisplayName     string   `json:"displayName"`
	GroupTypes      []string `json:"groupTypes"`
	MailEnabled     bool     `json:"mailEnabled"`
	MailNickname    string   `json:"mailNickname"`
	SecurityEnabled bool     `json:"securityEnabled"`
}

type CreateADGroupResponse

type CreateADGroupResponse struct {
	ID string `json:"id"`

	Description string `json:"description"`
	DisplayName string `json:"displayName"`
}

type CreateADUser

type CreateADUser struct {
	AccountEnabled    bool            `json:"accountEnabled"`
	DisplayName       string          `json:"displayName"`
	MailNickname      string          `json:"mailNickname"`
	UserPrincipalName string          `json:"userPrincipalName"`
	PasswordProfile   PasswordProfile `json:"passwordProfile"`
}

type GroupMembers

type GroupMembers struct {
	OdataNextLink *string  `json:"@odata.nextLink,omitempty"`
	OdataContext  string   `json:"@odata.context"`
	Value         []string `json:"value"`
}

type GroupNotFoundError

type GroupNotFoundError struct {
	Group string
}

func (*GroupNotFoundError) Error

func (e *GroupNotFoundError) Error() string

type ListGroupsResponse

type ListGroupsResponse struct {
	OdataContext  string       `json:"@odata.context"`
	OdataNextLink *string      `json:"@odata.nextLink,omitempty"`
	Value         []AzureGroup `json:"value"`
}

type ListUsersResponse

type ListUsersResponse struct {
	OdataContext  string      `json:"@odata.context"`
	OdataNextLink *string     `json:"@odata.nextLink,omitempty"`
	Value         []AzureUser `json:"value"`
}

type PasswordProfile

type PasswordProfile struct {
	ForceChangePasswordNextSignIn bool   `json:"forceChangePasswordNextSignIn"`
	Password                      string `json:"password"`
}

type Provider

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

func (*Provider) AddUserToGroup added in v0.3.1

func (c *Provider) AddUserToGroup(ctx context.Context, userID string, groupID string) error

GroupMember.ReadWrite.All

func (*Provider) ArgSchema

func (p *Provider) ArgSchema() providers.ArgSchema

func (*Provider) Config

func (a *Provider) Config() gconfig.Config

func (*Provider) CreateGroup added in v0.3.1

func (c *Provider) CreateGroup(ctx context.Context, group CreateADGroup) (*CreateADGroupResponse, error)

func (*Provider) CreateUser added in v0.3.1

func (c *Provider) CreateUser(ctx context.Context, user CreateADUser) error

func (*Provider) DeleteGroup added in v0.3.1

func (c *Provider) DeleteGroup(ctx context.Context, groupID string) error

func (*Provider) DeleteUser added in v0.3.1

func (c *Provider) DeleteUser(ctx context.Context, userID string) error

func (*Provider) GetGroup added in v0.3.1

func (c *Provider) GetGroup(ctx context.Context, groupID string) (*AzureGroup, error)

func (*Provider) GetUser added in v0.3.1

func (c *Provider) GetUser(ctx context.Context, userID string) (*AzureUser, error)

func (*Provider) Grant

func (p *Provider) Grant(ctx context.Context, subject string, args []byte, grantID string) error

Grant the access by calling azure's API.

func (*Provider) Init

func (a *Provider) Init(ctx context.Context) error

Init the Azure provider.

func (*Provider) IsActive

func (p *Provider) IsActive(ctx context.Context, subject string, args []byte, grantID string) (bool, error)

IsActive checks whether the access is active by calling Azure AD's API.

func (*Provider) ListGroupUsers added in v0.3.1

func (c *Provider) ListGroupUsers(ctx context.Context, groupID string) ([]AzureUser, error)

GroupMember.Read.All

func (*Provider) ListGroups added in v0.3.1

func (c *Provider) ListGroups(context.Context) ([]AzureGroup, error)

func (*Provider) ListUsers added in v0.3.1

func (c *Provider) ListUsers(ctx context.Context) ([]AzureUser, error)

func (*Provider) Options

func (p *Provider) Options(ctx context.Context, arg string) (*types.ArgOptionsResponse, error)

List options for arg

func (*Provider) RemoveUserFromGroup added in v0.3.1

func (c *Provider) RemoveUserFromGroup(ctx context.Context, userID string, groupID string) error

GroupMember.ReadWrite.All

func (*Provider) Revoke

func (p *Provider) Revoke(ctx context.Context, subject string, args []byte, grantID string) error

Revoke the access by calling Azure AD's API.

func (*Provider) SetupDocs added in v0.4.0

func (p *Provider) SetupDocs() embed.FS

SetupDocs returns the embedded filesystem containing setup documentation.

func (*Provider) TestConfig added in v0.3.1

func (p *Provider) TestConfig(ctx context.Context) error

func (*Provider) ValidateConfig added in v0.4.0

func (p *Provider) ValidateConfig() map[string]providers.ConfigValidationStep

func (*Provider) ValidateGrant added in v0.7.0

func (p *Provider) ValidateGrant() providers.GrantValidationSteps

type UserGroups

type UserGroups struct {
	OdataNextLink *string  `json:"@odata.nextLink,omitempty"`
	OdataContext  string   `json:"@odata.context"`
	Value         []string `json:"value"`
}

type UserNotFoundError

type UserNotFoundError struct {
	User string
}

func (*UserNotFoundError) Error

func (e *UserNotFoundError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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