msgraphclient

package
v0.0.0-...-98dd841 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DirectoryObjectTypeUnknown          = "unknown"
	DirectoryObjectTypeUser             = "user"
	DirectoryObjectTypeGroup            = "group"
	DirectoryObjectTypeApplication      = "application"
	DirectoryObjectTypeServicePrincipal = "serviceprincipal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryObject

type DirectoryObject struct {
	// general
	OdataType   string
	Type        string
	DisplayName string
	ObjectID    string

	DirectoryObject models.DirectoryObjectable

	// user
	UserPrincipalName *string
	Email             *string

	// servicePrincipal/application
	ServicePrincipalType *string
	ManagedIdentity      *string
	ApplicationID        *string
}

func (*DirectoryObject) IsApplication

func (obj *DirectoryObject) IsApplication() bool

IsApplication returns true if object is an application

func (*DirectoryObject) IsGroup

func (obj *DirectoryObject) IsGroup() bool

IsGroup returns true if object is a group

func (*DirectoryObject) IsServicePrincipal

func (obj *DirectoryObject) IsServicePrincipal() bool

IsServicePrincipal returns true if object is a servicePrincipal

func (*DirectoryObject) IsUser

func (obj *DirectoryObject) IsUser() bool

IsUser returns true if object is a user

type MsGraphClient

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

func NewMsGraphClient

func NewMsGraphClient(cloudConfig cloudconfig.CloudEnvironment, tenantID string, logger *zap.SugaredLogger) *MsGraphClient

NewMsGraphClient creates new MS Graph client

func NewMsGraphClientFromEnvironment

func NewMsGraphClientFromEnvironment(logger *zap.SugaredLogger) (*MsGraphClient, error)

NewMsGraphClientFromEnvironment creates new MS Graph client from environment settings

func NewMsGraphClientWithCloudName

func NewMsGraphClientWithCloudName(cloudName string, tenantID string, logger *zap.SugaredLogger) (*MsGraphClient, error)

NewMsGraphClientWithCloudName creates new MS Graph client with environment name as string

func (*MsGraphClient) GetTenantID

func (c *MsGraphClient) GetTenantID() string

GetTenantID returns the current set TenantID

func (*MsGraphClient) LookupPrincipalID

func (c *MsGraphClient) LookupPrincipalID(ctx context.Context, princpalIds ...string) (map[string]*DirectoryObject, error)

LookupPrincipalID returns information about AzureAD directory object by objectid

func (*MsGraphClient) NewAzCoreClientOptions

func (c *MsGraphClient) NewAzCoreClientOptions() *azcore.ClientOptions

NewAzCoreClientOptions returns new client options for all arm clients

func (*MsGraphClient) RequestAdapter

func (c *MsGraphClient) RequestAdapter() *msgraphsdk.GraphRequestAdapter

RequestAdapter returns msgraph request adapter

func (*MsGraphClient) ServiceClient

func (c *MsGraphClient) ServiceClient() *msgraphsdk.GraphServiceClient

ServiceClient returns msgraph service client

func (*MsGraphClient) SetCacheTtl

func (c *MsGraphClient) SetCacheTtl(ttl time.Duration)

SetCacheTtl set TTL for service discovery cache

func (*MsGraphClient) SetUserAgent

func (c *MsGraphClient) SetUserAgent(useragent string)

SetUserAgent set user agent for all API calls

func (*MsGraphClient) UseAzCliAuth

func (c *MsGraphClient) UseAzCliAuth()

UseAzCliAuth use (force) az cli authentication

Jump to

Keyboard shortcuts

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