Help us shape the future of Go! Take the 2026 Go Developer Survey

azuregraph

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 38 Imported by: 0

README

Microsoft Graph

Parity grade: B · SDK hashicorp/terraform-provider-azuread@v3.10.0 · last audited 2026-10-31 (666cb1c4c)

Coverage

Metric Value
PARITY entries audited 28 (12 ok, 16 partial)
Feature families 8 (6 ok, 2 partial)
Known gaps 10
Deferred items 0
Resource leaks clean
Known gaps
  • User GET and list return only the default property set (id, businessPhones, displayName, givenName, jobTitle, mail, mobilePhone, officeLocation, preferredLanguage, surname, userPrincipalName) unless $select is given, as recalled from the Get user reference; that list and the create-response shape are not verified against the live service. Unset properties are returned as explicit nulls.
  • Soft delete: deleted applications, service principals, users and groups are removed at once; /directory/deletedItems, restore and permanentDelete are not implemented.
  • Not implemented: $batch, federatedIdentityCredentials, directoryRoles/roleManagement, administrativeUnits, devices, contacts, applicationTemplates, tokenIssuancePolicies, claimsMappingPolicies, delta queries, extension attributes, users/{id}/manager, photos, licensing, @odata.bind on user manager, and the $expand option (answered with 400 Request_UnsupportedQuery).
  • Graph permissions are not enforced (no Authorization_RequestDenied for missing Application.ReadWrite.All and similar); requiredResourceAccess and appRoleAssignments are stored but grant nothing, and tokens carry no roles/scp claims.
  • Certificate credentials: addKey does not keep the key or verify the proof, so client_assertion/certificate token requests are not supported; password users cannot sign in (no ROPC or authorization-code flow), so /me needs a hand-built user token.
  • Error messages and codes not verified against the live service (recalled, not read from the reference): malformed ids ('Invalid object identifier'), duplicate identifierUris/uniqueName/UPN/servicePrincipalNames ('Another object with the same value for property ... already exists'), unknown property ('Property ... does not exist as a declared property'), the password complexity message, appRoleAssignment validation messages, group creation rules (mail-enabled and neither-flag refusals, isAssignableToRole), unsupported-method 405 code, and the 'Unable to read JSON request payload' text.
  • Built-in first-party service principals: only Microsoft Graph with a subset of its roles (Application.Read[Write].All, Directory.Read[Write].All, User.Read[Write].All, Group.Read[Write].All, Mail.Send) and scopes (User.Read, openid, profile, email, offline_access). Other well-known applications (Azure Service Management, Key Vault, ...) are absent, so looking them up by appId returns 404.
  • Deleting an application removes its service principal immediately, and disabling an app role that is still assigned is not refused; appRoles removal is not blocked while in use. Entra's rules for these are not verified.
  • Terraform azuread fixture (application with web redirect URIs and requiredResourceAccess, service principal, application password) applies, replans empty and destroys against the container (test/terraform/azure/azuread_test.go) using metadata_host and the dev client; other azuread resources (groups, users, app role assignments, federated credentials, directory roles) are not exercised.
  • ARM role assignment validation (--azure-arm-validate-principals) does not know system-assigned identities of VMs, web apps and other ARM resources, so it stays opt-in.

More

Documentation

Index

Constants

View Source
const DefaultDomain = "gopherstack.onmicrosoft.com"

DefaultDomain is the tenant's initial, default verified domain.

View Source
const DefaultPort = 10014

DefaultPort is the Microsoft Graph HTTPS listener.

View Source
const DefaultTenantID = "00000000-0000-0000-0000-000000000000"

DefaultTenantID is the dev tenant; it must equal --azure-arm-tenant-id for tokens to validate.

View Source
const MicrosoftGraphAppID = "00000003-0000-0000-c000-000000000000"

MicrosoftGraphAppID is the well-known application ID of the Microsoft Graph resource service principal.

Variables

View Source
var ErrNilAppContext = errors.New("azuregraph: nil app context")

ErrNilAppContext is returned by Provider.Init for a nil AppContext.

Functions

This section is empty.

Types

type APIApplication

type APIApplication struct {
	AcceptMappedClaims          *bool                      `json:"acceptMappedClaims"`
	RequestedAccessTokenVersion *int                       `json:"requestedAccessTokenVersion"`
	KnownClientApplications     []string                   `json:"knownClientApplications"`
	OAuth2PermissionScopes      []PermissionScope          `json:"oauth2PermissionScopes"`
	PreAuthorizedApplications   []PreAuthorizedApplication `json:"preAuthorizedApplications"`
}

APIApplication is the application's api facet.

type AppRole

type AppRole struct {
	ID                 string   `json:"id"`
	Description        string   `json:"description,omitempty"`
	DisplayName        string   `json:"displayName,omitempty"`
	Origin             string   `json:"origin,omitempty"`
	Value              string   `json:"value,omitempty"`
	AllowedMemberTypes []string `json:"allowedMemberTypes"`
	IsEnabled          bool     `json:"isEnabled"`
}

AppRole is an appRoles entry.

type AppRoleAssignment

type AppRoleAssignment struct {
	CreatedDateTime      time.Time `json:"createdDateTime"`
	ID                   string    `json:"id"`
	AppRoleID            string    `json:"appRoleId"`
	PrincipalID          string    `json:"principalId"`
	PrincipalType        string    `json:"principalType"`
	PrincipalDisplayName string    `json:"principalDisplayName"`
	ResourceID           string    `json:"resourceId"`
	ResourceDisplayName  string    `json:"resourceDisplayName"`
}

AppRoleAssignment grants an app role of a resource service principal to a principal.

type Application

type Application struct {
	CreatedDateTime            time.Time                `json:"createdDateTime"`
	IsDeviceOnlyAuthSupported  *bool                    `json:"isDeviceOnlyAuthSupported"`
	ServiceManagementReference string                   `json:"serviceManagementReference,omitempty"`
	Notes                      string                   `json:"notes,omitempty"`
	ApplicationTemplateID      string                   `json:"applicationTemplateId,omitempty"`
	PublisherDomain            string                   `json:"publisherDomain"`
	SAMLMetadataURL            string                   `json:"samlMetadataUrl,omitempty"`
	DefaultRedirectURI         string                   `json:"defaultRedirectUri,omitempty"`
	AppID                      string                   `json:"appId"`
	TokenEncryptionKeyID       string                   `json:"tokenEncryptionKeyId,omitempty"`
	ID                         string                   `json:"id"`
	GroupMembershipClaims      string                   `json:"groupMembershipClaims,omitempty"`
	SignInAudience             string                   `json:"signInAudience"`
	UniqueName                 string                   `json:"uniqueName,omitempty"`
	DisplayName                string                   `json:"displayName"`
	Description                string                   `json:"description,omitempty"`
	API                        APIApplication           `json:"api"`
	Certification              json.RawMessage          `json:"certification,omitempty"`
	VerifiedPublisher          json.RawMessage          `json:"verifiedPublisher,omitempty"`
	SPA                        RedirectFacet            `json:"spa"`
	DisabledByMicrosoftStatus  json.RawMessage          `json:"disabledByMicrosoftStatus,omitempty"`
	AddIns                     json.RawMessage          `json:"addIns,omitempty"`
	ParentalControlSettings    json.RawMessage          `json:"parentalControlSettings,omitempty"`
	Info                       json.RawMessage          `json:"info,omitempty"`
	OptionalClaims             json.RawMessage          `json:"optionalClaims,omitempty"`
	AuthenticationBehaviors    json.RawMessage          `json:"authenticationBehaviors,omitempty"`
	PublicClient               RedirectFacet            `json:"publicClient"`
	IdentifierURIs             []string                 `json:"identifierUris"`
	Tags                       []string                 `json:"tags"`
	AppRoles                   []AppRole                `json:"appRoles"`
	RequiredResourceAccess     []RequiredResourceAccess `json:"requiredResourceAccess"`
	PasswordCredentials        []PasswordCredential     `json:"passwordCredentials"`
	KeyCredentials             []KeyCredential          `json:"keyCredentials"`
	Web                        WebApplication           `json:"web"`
	IsFallbackPublicClient     bool                     `json:"isFallbackPublicClient"`
	OAuth2RequirePostResponse  bool                     `json:"oauth2RequirePostResponse"`
}

Application is an application registration.

type Backend

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

Backend is the in-memory directory shared by the Graph listener and the ARM token endpoint.

func NewBackend

func NewBackend(cfg Settings, opts ...Option) *Backend

NewBackend returns a directory seeded with the Microsoft Graph service principal.

func (*Backend) AddKey

func (b *Backend) AddKey(id string, in KeyCredential) (KeyCredential, error)

AddKey registers a key credential. The key material is validated but not retained.

func (*Backend) AddMember

func (b *Backend) AddMember(groupID, memberID string) error

AddMember adds a group member reference.

func (*Backend) AddOwner

func (b *Backend) AddOwner(id, ownerID string) error

AddOwner adds an owner reference.

func (*Backend) AddPassword

func (b *Backend) AddPassword(id string, in PasswordCredential) (PasswordCredential, error)

AddPassword adds a client secret to an application or service principal. The returned credential carries SecretText; it is the only time the secret is available.

func (*Backend) AuthenticateClient

func (b *Backend) AuthenticateClient(clientID, secret string) (string, bool, error)

AuthenticateClient checks a client-credentials request against the registered applications. known is false for a client ID no application or service principal uses, leaving the caller free to apply its own policy. On success objectID is the service principal's object ID, the token's oid claim.

func (*Backend) ByIDs

func (b *Backend) ByIDs(ids, types []string) ([]Object, error)

ByIDs resolves object IDs, optionally restricted to kinds ("user", "group", ... or "directoryObject").

func (*Backend) CreateAppRoleAssignment

func (b *Backend) CreateAppRoleAssignment(
	ownerID string, asResource bool, body map[string]json.RawMessage,
) (AppRoleAssignment, error)

CreateAppRoleAssignment grants an app role. ownerID is the path service principal, user or group; asResource selects appRoleAssignedTo (owner is the resource) over appRoleAssignments (owner is the principal).

func (*Backend) CreateApplication

func (b *Backend) CreateApplication(body map[string]json.RawMessage) (Application, error)

CreateApplication registers an application.

func (*Backend) CreateGrant

func (b *Backend) CreateGrant(body map[string]json.RawMessage) (OAuth2PermissionGrant, error)

CreateGrant records a delegated permission grant.

func (*Backend) CreateGroup

func (b *Backend) CreateGroup(body map[string]json.RawMessage) (Group, error)

CreateGroup creates a group; members@odata.bind and owners@odata.bind add references atomically.

func (*Backend) CreateServicePrincipal

func (b *Backend) CreateServicePrincipal(body map[string]json.RawMessage) (ServicePrincipal, error)

CreateServicePrincipal instantiates an application in the tenant; body.appId must name a registered application.

func (*Backend) CreateUser

func (b *Backend) CreateUser(body map[string]json.RawMessage) (User, error)

CreateUser creates a user. passwordProfile is validated and discarded.

func (*Backend) DeleteAppRoleAssignment

func (b *Backend) DeleteAppRoleAssignment(id, assignmentID string, asResource bool) error

DeleteAppRoleAssignment removes an assignment owned by id.

func (*Backend) DeleteApplication

func (b *Backend) DeleteApplication(r Ref) error

DeleteApplication removes an application and its service principal.

func (*Backend) DeleteGrant

func (b *Backend) DeleteGrant(id string) error

DeleteGrant removes a grant.

func (*Backend) DeleteGroup

func (b *Backend) DeleteGroup(r Ref) error

DeleteGroup removes a group.

func (*Backend) DeleteServicePrincipal

func (b *Backend) DeleteServicePrincipal(r Ref) error

DeleteServicePrincipal removes a service principal.

func (*Backend) DeleteUser

func (b *Backend) DeleteUser(r Ref) error

DeleteUser removes a user.

func (*Backend) GetApplication

func (b *Backend) GetApplication(r Ref) (Application, error)

GetApplication returns an application.

func (*Backend) GetGroup

func (b *Backend) GetGroup(r Ref) (Group, error)

GetGroup returns a group.

func (*Backend) GetObject

func (b *Backend) GetObject(id string) (Object, error)

GetObject returns any directory object by ID.

func (*Backend) GetServicePrincipal

func (b *Backend) GetServicePrincipal(r Ref) (ServicePrincipal, error)

GetServicePrincipal returns a service principal.

func (*Backend) GetUser

func (b *Backend) GetUser(r Ref) (User, error)

GetUser returns a user by object ID or user principal name.

func (*Backend) ListAppRoleAssignments

func (b *Backend) ListAppRoleAssignments(id string, asResource bool) ([]AppRoleAssignment, error)

ListAppRoleAssignments lists assignments where id is the principal, or (asResource) the resource.

func (*Backend) ListApplications

func (b *Backend) ListApplications() []Application

ListApplications returns every application in creation order.

func (*Backend) ListGrants

func (b *Backend) ListGrants() []OAuth2PermissionGrant

ListGrants returns every delegated permission grant.

func (*Backend) ListGroups

func (b *Backend) ListGroups() []Group

ListGroups returns every group in creation order.

func (*Backend) ListServicePrincipals

func (b *Backend) ListServicePrincipals() []ServicePrincipal

ListServicePrincipals returns every service principal in creation order.

func (*Backend) ListUsers

func (b *Backend) ListUsers() []User

ListUsers returns every user in creation order.

func (*Backend) MemberOf

func (b *Backend) MemberOf(id string, transitive bool) ([]Object, error)

MemberOf lists the groups id belongs to, directly or (transitive) through nesting.

func (*Backend) Members

func (b *Backend) Members(id string) ([]Object, error)

Members lists the direct members of a group.

func (*Backend) ObjectKind

func (b *Backend) ObjectKind(id string) (string, bool)

ObjectKind reports whether id names a directory object and its kind.

func (*Backend) Owners

func (b *Backend) Owners(id string) ([]Object, error)

Owners lists the owners of an application, service principal or group.

func (*Backend) PrincipalType

func (b *Backend) PrincipalType(id string) (string, bool)

PrincipalType reports whether id is a user, group or service principal and returns its role-assignment principal type (User, Group or ServicePrincipal).

func (*Backend) RemoveKey

func (b *Backend) RemoveKey(id, keyID string) error

RemoveKey deletes a key credential.

func (*Backend) RemoveMember

func (b *Backend) RemoveMember(groupID, memberID string) error

RemoveMember removes a group member reference.

func (*Backend) RemoveOwner

func (b *Backend) RemoveOwner(id, ownerID string) error

RemoveOwner removes an owner reference.

func (*Backend) RemovePassword

func (b *Backend) RemovePassword(id, keyID string) error

RemovePassword deletes a client secret.

func (*Backend) Reset

func (b *Backend) Reset()

Reset drops all state and re-seeds the built-in service principals.

func (*Backend) Restore

func (b *Backend) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable.

func (*Backend) Snapshot

func (b *Backend) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable. Secrets are salted PBKDF2 hashes; plaintext is never stored.

func (*Backend) TenantID

func (b *Backend) TenantID() string

TenantID returns the directory's tenant.

func (*Backend) TransitiveMembers

func (b *Backend) TransitiveMembers(id string) ([]Object, error)

TransitiveMembers lists a group's members including those of nested groups.

func (*Backend) UpdateApplication

func (b *Backend) UpdateApplication(r Ref, body map[string]json.RawMessage) error

UpdateApplication applies a PATCH body.

func (*Backend) UpdateGrant

func (b *Backend) UpdateGrant(id string, body map[string]json.RawMessage) error

UpdateGrant changes the scope of a grant.

func (*Backend) UpdateGroup

func (b *Backend) UpdateGroup(r Ref, body map[string]json.RawMessage) error

UpdateGroup applies a PATCH body. isAssignableToRole can only be set at creation.

func (*Backend) UpdateServicePrincipal

func (b *Backend) UpdateServicePrincipal(r Ref, body map[string]json.RawMessage) error

UpdateServicePrincipal applies a PATCH body.

func (*Backend) UpdateUser

func (b *Backend) UpdateUser(r Ref, body map[string]json.RawMessage) error

UpdateUser applies a PATCH body.

type ClientAuthError

type ClientAuthError struct {
	Name        string
	Description string
	Status      int
	Code        int
}

ClientAuthError is an Entra token endpoint failure for a client-credentials request.

func (*ClientAuthError) Error

func (e *ClientAuthError) Error() string

type ConfigProvider

type ConfigProvider interface {
	GetAzureGraphSettings() Settings
}

ConfigProvider extracts the Microsoft Graph settings from the AppContext config.

type Error

type Error struct {
	Code    string
	Message string
	Status  int
}

Error is a Graph failure rendered as an OData error envelope.

func (*Error) Error

func (e *Error) Error() string

type Group

type Group struct {
	CreatedDateTime               time.Time `json:"createdDateTime"`
	IsAssignableToRole            *bool     `json:"isAssignableToRole"`
	MembershipRule                string    `json:"membershipRule,omitempty"`
	MembershipRuleProcessingState string    `json:"membershipRuleProcessingState,omitempty"`
	MailNickname                  string    `json:"mailNickname"`
	Mail                          string    `json:"mail,omitempty"`
	Visibility                    string    `json:"visibility,omitempty"`
	Classification                string    `json:"classification,omitempty"`
	DisplayName                   string    `json:"displayName"`
	Description                   string    `json:"description,omitempty"`
	PreferredDataLocation         string    `json:"preferredDataLocation,omitempty"`
	ID                            string    `json:"id"`
	ResourceBehaviorOptions       []string  `json:"resourceBehaviorOptions"`
	ResourceProvisioningOptions   []string  `json:"resourceProvisioningOptions"`
	GroupTypes                    []string  `json:"groupTypes"`
	MailEnabled                   bool      `json:"mailEnabled"`
	SecurityEnabled               bool      `json:"securityEnabled"`
}

Group is a security, Microsoft 365 or distribution group.

type Handler

type Handler struct {
	Backend *Backend
	// Issuer verifies bearer tokens when Settings.ValidateTokens is set; cli wiring shares ARM's issuer.
	Issuer *aadauth.Issuer

	// Settings holds the listener configuration.
	Settings Settings
	// Port is the fixed TCP port StartWorker binds.
	Port int
	// contains filtered or unexported fields
}

Handler serves Microsoft Graph v1.0 directory APIs on a dedicated HTTPS listener.

func NewHandler

func NewHandler(backend *Backend, settings Settings) *Handler

NewHandler creates a Handler.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation names the operation for metrics.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns the request path for metrics.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations lists the operation names ExtractOperation can return.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler for the Graph API.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority is irrelevant because RouteMatcher never matches.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher never matches: Microsoft Graph runs on its own listener.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the listener.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the fixed port and serves HTTPS, failing fast if the port is taken.

type ImplicitGrantSettings

type ImplicitGrantSettings struct {
	EnableAccessTokenIssuance bool `json:"enableAccessTokenIssuance"`
	EnableIDTokenIssuance     bool `json:"enableIdTokenIssuance"`
}

ImplicitGrantSettings is web.implicitGrantSettings.

type KeyCredential

type KeyCredential struct {
	StartDateTime       time.Time `json:"startDateTime"`
	EndDateTime         time.Time `json:"endDateTime"`
	Key                 *string   `json:"key"`
	CustomKeyIdentifier *string   `json:"customKeyIdentifier"`
	DisplayName         *string   `json:"displayName"`
	KeyID               string    `json:"keyId"`
	Type                string    `json:"type"`
	Usage               string    `json:"usage"`
}

KeyCredential is a certificate or key credential; the key material is never returned.

type OAuth2PermissionGrant

type OAuth2PermissionGrant struct {
	ID          string `json:"id"`
	ClientID    string `json:"clientId"`
	ConsentType string `json:"consentType"`
	PrincipalID string `json:"principalId,omitempty"`
	ResourceID  string `json:"resourceId"`
	Scope       string `json:"scope"`
}

OAuth2PermissionGrant is a delegated permission grant.

type Object

type Object struct {
	Entity any
	Kind   string
}

Object is a directory object of any kind with its entity (Application, ServicePrincipal, User or Group).

type Option

type Option func(*Backend)

Option customises a Backend.

func WithClock

func WithClock(now func() time.Time) Option

WithClock replaces the wall clock.

type PasswordCredential

type PasswordCredential struct {
	StartDateTime       time.Time `json:"startDateTime"`
	EndDateTime         time.Time `json:"endDateTime"`
	SecretText          *string   `json:"secretText"`
	CustomKeyIdentifier *string   `json:"customKeyIdentifier"`
	DisplayName         *string   `json:"displayName"`
	Hint                *string   `json:"hint"`
	KeyID               string    `json:"keyId"`
}

PasswordCredential is a client secret; SecretText is only set in the addPassword response.

type PasswordProfile

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

PasswordProfile is accepted on write and never returned.

type PermissionScope

type PermissionScope struct {
	ID                      string `json:"id"`
	AdminConsentDescription string `json:"adminConsentDescription,omitempty"`
	AdminConsentDisplayName string `json:"adminConsentDisplayName,omitempty"`
	Type                    string `json:"type,omitempty"`
	UserConsentDescription  string `json:"userConsentDescription,omitempty"`
	UserConsentDisplayName  string `json:"userConsentDisplayName,omitempty"`
	Value                   string `json:"value,omitempty"`
	IsEnabled               bool   `json:"isEnabled"`
}

PermissionScope is an api.oauth2PermissionScopes entry.

type PreAuthorizedApplication

type PreAuthorizedApplication struct {
	AppID                  string   `json:"appId"`
	DelegatedPermissionIDs []string `json:"delegatedPermissionIds"`
}

PreAuthorizedApplication is an api.preAuthorizedApplications entry.

type Provider

type Provider struct{}

Provider implements service.Provider for Microsoft Graph.

func (*Provider) Init

Init builds the backend and handler; the port is bound by Handler.StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type RedirectFacet

type RedirectFacet struct {
	RedirectURIs []string `json:"redirectUris"`
}

RedirectFacet carries redirectUris for the spa and publicClient facets.

type Ref

type Ref struct {
	ID    string
	Field string
	Value string
}

Ref addresses an object by ID or by an alternate key such as applications(appId='...').

type RequiredResourceAccess

type RequiredResourceAccess struct {
	ResourceAppID  string           `json:"resourceAppId"`
	ResourceAccess []ResourceAccess `json:"resourceAccess"`
}

RequiredResourceAccess declares the permissions an application needs from one resource.

type ResourceAccess

type ResourceAccess struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

ResourceAccess is a requiredResourceAccess.resourceAccess entry.

type ServicePrincipal

type ServicePrincipal struct {
	AddIns                        json.RawMessage      `json:"addIns,omitempty"`
	DisabledByMicrosoftStatus     json.RawMessage      `json:"disabledByMicrosoftStatus,omitempty"`
	ResourceSpecificPermissions   json.RawMessage      `json:"resourceSpecificApplicationPermissions,omitempty"`
	PasswordSSOSettings           json.RawMessage      `json:"passwordSingleSignOnSettings,omitempty"`
	PreferredKeyEndDateTime       json.RawMessage      `json:"preferredTokenSigningKeyEndDateTime,omitempty"`
	CustomSecurityAttributes      json.RawMessage      `json:"customSecurityAttributes,omitempty"`
	SAMLMetadataURL               string               `json:"samlMetadataUrl,omitempty"`
	ApplicationTemplateID         string               `json:"applicationTemplateId,omitempty"`
	CreatedDateTime               time.Time            `json:"createdDateTime"`
	Info                          json.RawMessage      `json:"info,omitempty"`
	VerifiedPublisher             json.RawMessage      `json:"verifiedPublisher,omitempty"`
	SAMLSingleSignOnSettings      json.RawMessage      `json:"samlSingleSignOnSettings,omitempty"`
	ID                            string               `json:"id"`
	AppID                         string               `json:"appId"`
	DisplayName                   string               `json:"displayName"`
	AppDisplayName                string               `json:"appDisplayName"`
	AppDescription                string               `json:"appDescription,omitempty"`
	AppOwnerOrganizationID        string               `json:"appOwnerOrganizationId,omitempty"`
	Description                   string               `json:"description,omitempty"`
	LoginURL                      string               `json:"loginUrl,omitempty"`
	LogoutURL                     string               `json:"logoutUrl,omitempty"`
	Homepage                      string               `json:"homepage,omitempty"`
	Notes                         string               `json:"notes,omitempty"`
	PreferredSingleSignOnMode     string               `json:"preferredSingleSignOnMode,omitempty"`
	PreferredTokenSigningKeyThumb string               `json:"preferredTokenSigningKeyThumbprint,omitempty"`
	ServicePrincipalType          string               `json:"servicePrincipalType"`
	SignInAudience                string               `json:"signInAudience"`
	TokenEncryptionKeyID          string               `json:"tokenEncryptionKeyId,omitempty"`
	AlternativeNames              []string             `json:"alternativeNames"`
	NotificationEmailAddresses    []string             `json:"notificationEmailAddresses"`
	ReplyURLs                     []string             `json:"replyUrls"`
	ServicePrincipalNames         []string             `json:"servicePrincipalNames"`
	Tags                          []string             `json:"tags"`
	AppRoles                      []AppRole            `json:"appRoles"`
	OAuth2PermissionScopes        []PermissionScope    `json:"oauth2PermissionScopes"`
	PasswordCredentials           []PasswordCredential `json:"passwordCredentials"`
	KeyCredentials                []KeyCredential      `json:"keyCredentials"`
	AccountEnabled                bool                 `json:"accountEnabled"`
	AppRoleAssignmentRequired     bool                 `json:"appRoleAssignmentRequired"`
}

ServicePrincipal is the local instance of an application in the tenant.

type Settings

type Settings struct {
	TLSCertFile string `` //nolint:lll // config struct tags are intentionally verbose
	/* 241-byte string literal not displayed */
	TLSKeyFile string `` //nolint:lll // config struct tags are intentionally verbose
	/* 138-byte string literal not displayed */
	TenantID string `` //nolint:lll // config struct tags are intentionally verbose
	/* 288-byte string literal not displayed */
	DefaultDomain string `` //nolint:lll // config struct tags are intentionally verbose
	/* 279-byte string literal not displayed */
	DevClientID string `` //nolint:lll // config struct tags are intentionally verbose
	/* 288-byte string literal not displayed */
	ExtraDomains string `` //nolint:lll // config struct tags are intentionally verbose
	/* 130-byte string literal not displayed */
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 257-byte string literal not displayed */
	ValidateTokens bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 257-byte string literal not displayed */
}

Settings is the Kong-embedded configuration of the Microsoft Graph emulator.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the settings used when no ConfigProvider exists.

type User

type User struct {
	CreatedDateTime   time.Time        `json:"createdDateTime"`
	PasswordProfile   *PasswordProfile `json:"passwordProfile,omitempty"`
	ID                string           `json:"id"`
	UserPrincipalName string           `json:"userPrincipalName"`
	DisplayName       string           `json:"displayName"`
	MailNickname      string           `json:"mailNickname"`
	GivenName         string           `json:"givenName,omitempty"`
	Surname           string           `json:"surname,omitempty"`
	Mail              string           `json:"mail,omitempty"`
	JobTitle          string           `json:"jobTitle,omitempty"`
	Department        string           `json:"department,omitempty"`
	CompanyName       string           `json:"companyName,omitempty"`
	OfficeLocation    string           `json:"officeLocation,omitempty"`
	City              string           `json:"city,omitempty"`
	State             string           `json:"state,omitempty"`
	Country           string           `json:"country,omitempty"`
	StreetAddress     string           `json:"streetAddress,omitempty"`
	PostalCode        string           `json:"postalCode,omitempty"`
	MobilePhone       string           `json:"mobilePhone,omitempty"`
	PreferredLanguage string           `json:"preferredLanguage,omitempty"`
	UsageLocation     string           `json:"usageLocation,omitempty"`
	EmployeeID        string           `json:"employeeId,omitempty"`
	PasswordPolicies  string           `json:"passwordPolicies,omitempty"`
	OnPremImmutableID string           `json:"onPremisesImmutableId,omitempty"`
	UserType          string           `json:"userType"`
	BusinessPhones    []string         `json:"businessPhones"`
	OtherMails        []string         `json:"otherMails"`
	AccountEnabled    bool             `json:"accountEnabled"`
}

User is a directory user.

type WebApplication

type WebApplication struct {
	HomePageURL           string                `json:"homePageUrl"`
	LogoutURL             string                `json:"logoutUrl"`
	RedirectURIs          []string              `json:"redirectUris"`
	ImplicitGrantSettings ImplicitGrantSettings `json:"implicitGrantSettings"`
}

WebApplication is the application's web facet.

Jump to

Keyboard shortcuts

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