Documentation
¶
Overview ¶
Package graph implements the Microsoft Graph slice that Azure's account inventory, iam-user, and iam-credential validation flows need.
Index ¶
- type Application
- type Client
- func (c *Client) AddPassword(ctx context.Context, appOrObjectID, displayName string) (PasswordCredential, error)
- func (c *Client) CreateUser(ctx context.Context, displayName, userPrincipalName, password string) (User, error)
- func (c *Client) DeleteUser(ctx context.Context, idOrUPN string) error
- func (c *Client) ListPasswordCredentials(ctx context.Context, appOrObjectID string) (Application, error)
- func (c *Client) ListUsers(ctx context.Context) ([]User, error)
- func (c *Client) RemovePassword(ctx context.Context, appOrObjectID, keyID string) error
- type PasswordCredential
- type SignInActivity
- type User
- type UserPasswordProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
ID string `json:"id"`
DisplayName string `json:"displayName"`
AppID string `json:"appId"`
PasswordCredentials []PasswordCredential `json:"passwordCredentials"`
}
Application is a partial projection of the Graph application resource covering only the fields the iam-credential driver needs.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin Microsoft Graph wrapper that signs requests with a Graph-scoped token source.
func NewClient ¶
NewClient returns a Graph client. Callers typically build the token source via `auth.NewTokenSourceForScope(cred, httpClient, baseURL+".default")`.
func (*Client) AddPassword ¶
func (c *Client) AddPassword(ctx context.Context, appOrObjectID, displayName string) (PasswordCredential, error)
AddPassword mints a fresh client secret on the named application. displayName is optional metadata stored alongside the credential.
func (*Client) CreateUser ¶
func (c *Client) CreateUser(ctx context.Context, displayName, userPrincipalName, password string) (User, error)
CreateUser provisions a Microsoft Graph user (Azure AD user) with the supplied initial password.
func (*Client) DeleteUser ¶
DeleteUser removes a Microsoft Graph user by objectId or userPrincipalName.
func (*Client) ListPasswordCredentials ¶
func (c *Client) ListPasswordCredentials(ctx context.Context, appOrObjectID string) (Application, error)
ListPasswordCredentials returns the password credentials attached to the application identified by appOrObjectID. The argument may be either an objectId (preferred — used directly) or an appId (resolved via /applications filter).
type PasswordCredential ¶
type PasswordCredential struct {
KeyID string `json:"keyId"`
DisplayName string `json:"displayName,omitempty"`
StartDateTime string `json:"startDateTime,omitempty"`
EndDateTime string `json:"endDateTime,omitempty"`
SecretText string `json:"secretText,omitempty"`
Hint string `json:"hint,omitempty"`
}
PasswordCredential mirrors the Microsoft Graph passwordCredential resource.
type SignInActivity ¶
type SignInActivity struct {
LastSignInDateTime string `json:"lastSignInDateTime,omitempty"`
}
type User ¶
type User struct {
ID string `json:"id,omitempty"`
AccountEnabled bool `json:"accountEnabled"`
DisplayName string `json:"displayName"`
MailNickname string `json:"mailNickname"`
UserPrincipalName string `json:"userPrincipalName"`
CreatedDateTime string `json:"createdDateTime,omitempty"`
SignInActivity *SignInActivity `json:"signInActivity,omitempty"`
PasswordProfile *UserPasswordProfile `json:"passwordProfile,omitempty"`
}
User is a slim projection of the Microsoft Graph user resource for the validation flow's needs.
type UserPasswordProfile ¶
type UserPasswordProfile struct {
Password string `json:"password"`
ForceChangePasswordNextSignIn bool `json:"forceChangePasswordNextSignIn"`
}
UserPasswordProfile carries the initial password assigned at user creation.