api

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application added in v0.17.0

type Application struct {
	AppID               string
	AppObjectID         string
	PasswordCredentials []PasswordCredential
}

type ApplicationsClient

type ApplicationsClient interface {
	GetApplication(ctx context.Context, clientID string) (Application, error)
	CreateApplication(ctx context.Context, displayName string, signInAudience string, tags []string) (Application, error)
	DeleteApplication(ctx context.Context, applicationObjectID string, permanentlyDelete bool) error
	ListApplications(ctx context.Context, filter string) ([]Application, error)
	AddApplicationPassword(ctx context.Context, applicationObjectID string, displayName string, endDateTime time.Time) (PasswordCredential, error)
	RemoveApplicationPassword(ctx context.Context, applicationObjectID string, keyID string) error
}

type Group

type Group struct {
	ID          string
	DisplayName string
}

type GroupsClient

type GroupsClient interface {
	AddGroupMember(ctx context.Context, groupObjectID string, memberObjectID string) error
	RemoveGroupMember(ctx context.Context, groupObjectID, memberObjectID string) error
	GetGroup(ctx context.Context, objectID string) (result Group, err error)
	ListGroups(ctx context.Context, filter string) (result []Group, err error)
}

type MSGraphClient added in v0.17.0

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

func NewMSGraphClient added in v0.17.0

func NewMSGraphClient(graphURI string, creds azcore.TokenCredential) (*MSGraphClient, error)

NewMSGraphClient returns a new MSGraphClient configured to interact with the Microsoft Graph API. It can be configured to target alternative national cloud deployments via graphURI. For details on the client configuration see https://learn.microsoft.com/en-us/graph/sdks/national-clouds

func (*MSGraphClient) AddApplicationPassword added in v0.17.0

func (c *MSGraphClient) AddApplicationPassword(ctx context.Context, applicationObjectID string, displayName string, endDateTime time.Time) (PasswordCredential, error)

func (*MSGraphClient) AddGroupMember added in v0.17.0

func (c *MSGraphClient) AddGroupMember(ctx context.Context, groupObjectID string, memberObjectID string) error

func (*MSGraphClient) CreateApplication added in v0.17.0

func (c *MSGraphClient) CreateApplication(ctx context.Context, displayName string, signInAudience string, tags []string) (Application, error)

CreateApplication create a new Azure application object.

func (*MSGraphClient) CreateServicePrincipal added in v0.17.0

func (c *MSGraphClient) CreateServicePrincipal(ctx context.Context, appID string, startDate time.Time, endDate time.Time) (string, string, error)

func (*MSGraphClient) DeleteApplication added in v0.17.0

func (c *MSGraphClient) DeleteApplication(ctx context.Context, applicationObjectID string, permanentlyDelete bool) error

DeleteApplication deletes an Azure application object. This will in turn remove the service principal (but not the role assignments).

func (*MSGraphClient) DeleteServicePrincipal added in v0.17.0

func (c *MSGraphClient) DeleteServicePrincipal(ctx context.Context, spObjectID string, permanentlyDelete bool) error

func (*MSGraphClient) GetApplication added in v0.17.0

func (c *MSGraphClient) GetApplication(ctx context.Context, clientID string) (Application, error)

func (*MSGraphClient) GetGroup added in v0.17.0

func (c *MSGraphClient) GetGroup(ctx context.Context, groupID string) (Group, error)

func (*MSGraphClient) GetServicePrincipalByID added in v0.17.0

func (c *MSGraphClient) GetServicePrincipalByID(ctx context.Context, spObjectID string) (ServicePrincipal, error)

func (*MSGraphClient) ListApplications added in v0.17.0

func (c *MSGraphClient) ListApplications(ctx context.Context, filter string) ([]Application, error)

func (*MSGraphClient) ListGroups added in v0.17.0

func (c *MSGraphClient) ListGroups(ctx context.Context, filter string) ([]Group, error)

func (*MSGraphClient) ListServicePrincipals added in v0.17.0

func (c *MSGraphClient) ListServicePrincipals(ctx context.Context, spObjectID string) ([]ServicePrincipal, error)

func (*MSGraphClient) RemoveApplicationPassword added in v0.17.0

func (c *MSGraphClient) RemoveApplicationPassword(ctx context.Context, applicationObjectID string, keyID string) error

func (*MSGraphClient) RemoveGroupMember added in v0.17.0

func (c *MSGraphClient) RemoveGroupMember(ctx context.Context, groupObjectID, memberObjectID string) error

type PasswordCredential

type PasswordCredential struct {
	EndDate    time.Time
	KeyID      string
	SecretText string
}

type ServicePrincipal

type ServicePrincipal struct {
	ID    string
	AppID string
}

type ServicePrincipalClient

type ServicePrincipalClient interface {
	// CreateServicePrincipal in Azure. The password returned is the actual password that the appID was created with
	CreateServicePrincipal(ctx context.Context, appID string, startDate time.Time, endDate time.Time) (id string, password string, err error)
	DeleteServicePrincipal(ctx context.Context, spObjectID string, permanentlyDelete bool) error
}

Jump to

Keyboard shortcuts

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