Documentation ¶
Index ¶
- Constants
- Variables
- func GetErrorCodeAndMessage(ctx context.Context, err error) (string, string)
- func GroupToAzure(cg *models.Group) *graphmodels.Group
- func GroupToCloudy(g graphmodels.Groupable) *models.Group
- func ParseUserCustomSecurityAttributes(user *cloudymodels.User) *models.CustomSecurityAttributeValue
- func UpdateAzUser(ctx context.Context, azUser models.Userable, cUser *cloudymodels.User)
- func UserToAzure(user *cloudymodels.User) *models.User
- func UserToCloudy(user models.Userable) *cloudymodels.User
- func UserToPatch(user *cloudymodels.User, currentUser *cloudymodels.User) *models.User
- type MSGraphCredentialLoader
- type MsGraph
- type MsGraphConfig
- type MsGraphGroupManager
- func (gm *MsGraphGroupManager) AddMembers(ctx context.Context, groupId string, userIds []string) error
- func (gm *MsGraphGroupManager) DeleteGroup(ctx context.Context, groupId string) error
- func (gm *MsGraphGroupManager) GetGroup(ctx context.Context, id string) (*models.Group, error)
- func (gm *MsGraphGroupManager) GetGroupId(ctx context.Context, name string) (string, error)
- func (gm *MsGraphGroupManager) GetGroupMembers(ctx context.Context, grpId string) ([]*models.User, error)
- func (gm *MsGraphGroupManager) GetUserGroups(ctx context.Context, uid string) ([]*cloudymodels.Group, error)
- func (gm *MsGraphGroupManager) ListGroups(ctx context.Context, filter string, attrs []string) (*[]models.Group, error)
- func (gm *MsGraphGroupManager) NewGroup(ctx context.Context, grp *models.Group) (*models.Group, error)
- func (gm *MsGraphGroupManager) RemoveMembers(ctx context.Context, groupId string, userIds []string) error
- func (gm *MsGraphGroupManager) UpdateGroup(ctx context.Context, grp *models.Group) (bool, error)
- type MsGraphGroupManagerFactory
- type MsGraphInstance
- type MsGraphInviteManager
- type MsGraphInviteManagerFactory
- type MsGraphLicenseManager
- func (lm *MsGraphLicenseManager) AssignLicense(ctx context.Context, userId string, licenseSkus ...string) error
- func (lm *MsGraphLicenseManager) GetAssigned(ctx context.Context, licenseSku string) ([]*cloudymodels.User, error)
- func (lm *MsGraphLicenseManager) GetUserAssigned(ctx context.Context, uid string) ([]*license.LicenseDescription, error)
- func (lm *MsGraphLicenseManager) ListLicenses(ctx context.Context) ([]*license.LicenseDescription, error)
- func (lm *MsGraphLicenseManager) RemoveLicense(ctx context.Context, userId string, licenseSkus ...string) error
- type MsGraphLicenseManagerFactory
- type MsGraphUserManager
- func (um *MsGraphUserManager) AssocateCerificateMFA(ctx context.Context, uid string, certId string, replace bool) error
- func (um *MsGraphUserManager) DeleteUser(ctx context.Context, uid string) error
- func (um *MsGraphUserManager) Disable(ctx context.Context, uid string) error
- func (um *MsGraphUserManager) Enable(ctx context.Context, uid string) error
- func (um *MsGraphUserManager) ForceUserName(ctx context.Context, name string) (string, bool, error)
- func (um *MsGraphUserManager) GetCertificateMFA(ctx context.Context, uid string) ([]string, error)
- func (um *MsGraphUserManager) GetProfilePicture(ctx context.Context, uid string) ([]byte, error)
- func (um *MsGraphUserManager) GetUser(ctx context.Context, uid string) (*cloudymodels.User, error)
- func (um *MsGraphUserManager) GetUserByEmail(ctx context.Context, email string, opts *cloudy.UserOptions) (*cloudymodels.User, error)
- func (um *MsGraphUserManager) GetUserWithAttributes(ctx context.Context, uid string, attrs []string) (*cloudymodels.User, error)
- func (um *MsGraphUserManager) ListUsers(ctx context.Context, filter string, attrs []string) (*[]cloudymodels.User, error)
- func (um *MsGraphUserManager) NewUser(ctx context.Context, newUser *cloudymodels.User) (*cloudymodels.User, error)
- func (um *MsGraphUserManager) SetUserPassword(ctx context.Context, uid string, pwd string, mustChange bool) error
- func (um *MsGraphUserManager) UpdateUser(ctx context.Context, usr *cloudymodels.User) error
- func (um *MsGraphUserManager) UploadProfilePicture(ctx context.Context, uid string, picture []byte) error
- type MsGraphUserManagerFactory
- type UserCustomSecurityAttributes
Constants ¶
const BadRequest = "Request_BadRequest"
const ImageNotFoundCode = "ImageNotFound"
const MSGraphCredentialsKey = "msgraph"
const MsGraphName = "msgraph"
const ResourceNotFoundCode = "Request_ResourceNotFound"
Variables ¶
var AdditionalAttributes = []string{
"customSecurityAttributes",
"businessPhones",
"jobTitle",
"mobilePhone",
"officeLocation",
"assignedLicenses",
"companyName",
"authorizationInfo",
"streetAddress",
}
var AzurePublic = MsGraphInstance{
Name: "Public",
Login: "https://login.microsoftonline.com/",
Base: "https://graph.microsoft.com/v1.0",
}
var DefaultUserSelectFields = []string{
"accountEnabled",
"displayName",
"givenName",
"id",
"mail",
"surname",
"userPrincipalName",
}
var ErrInvalidInstanceName = errors.New("invalid instance name")
var GCCHighAADP2 = "e1b29dba-2e29-4e1e-9c0b-784303f4fb7f"
var GCCHighOffice365E3 = "aea38a85-9bd5-4981-aa00-616b411205bf"
var GCCHighProjectPlan3 = "64758d81-92b7-4855-bcac-06617becb3e8"
var GCCHighTeamsAudio = "4dee1f32-0808-4fd2-a2ed-fdd575e3a45f"
var GCCHighTeamsPhone = "985fcb26-7b94-475b-b512-89356697be71"
var GCCHighVisioPlan1 = "50a4284d-f0b2-4779-8de6-72c5f9b4349f"
var SigninActivityField = "signInActivity"
var USGovernment = MsGraphInstance{
Name: "USGovernment",
Login: "https://login.microsoftonline.us/",
Base: "https://graph.microsoft.us/v1.0",
}
Functions ¶
func GetErrorCodeAndMessage ¶ added in v0.0.19
func GroupToAzure ¶ added in v0.0.9
func GroupToAzure(cg *models.Group) *graphmodels.Group
func GroupToCloudy ¶ added in v0.0.9
func GroupToCloudy(g graphmodels.Groupable) *models.Group
func ParseUserCustomSecurityAttributes ¶ added in v0.0.25
func ParseUserCustomSecurityAttributes(user *cloudymodels.User) *models.CustomSecurityAttributeValue
func UpdateAzUser ¶ added in v0.0.22
func UserToAzure ¶ added in v0.0.2
func UserToAzure(user *cloudymodels.User) *models.User
func UserToCloudy ¶ added in v0.0.2
func UserToCloudy(user models.Userable) *cloudymodels.User
func UserToPatch ¶ added in v0.0.22
func UserToPatch(user *cloudymodels.User, currentUser *cloudymodels.User) *models.User
Types ¶
type MSGraphCredentialLoader ¶ added in v0.0.11
type MSGraphCredentialLoader struct{}
func (*MSGraphCredentialLoader) ReadFromEnv ¶ added in v0.0.11
func (loader *MSGraphCredentialLoader) ReadFromEnv(env *cloudy.Environment) interface{}
type MsGraph ¶ added in v0.0.9
type MsGraph struct { Client *msgraphsdk.GraphServiceClient Adapter *msgraphsdk.GraphRequestAdapter Cfg *MsGraphConfig }
func (*MsGraph) Configure ¶ added in v0.0.9
func (azUM *MsGraph) Configure(azConfig *MsGraphConfig) error
func (*MsGraph) DebugSerialize ¶ added in v0.0.9
func (graph *MsGraph) DebugSerialize(v serialization.Parsable)
type MsGraphConfig ¶ added in v0.0.9
type MsGraphConfig struct { TenantID string ClientID string ClientSecret string Region string APIBase string SelectFields []string }
func (*MsGraphConfig) SetInstance ¶ added in v0.0.9
func (azConfig *MsGraphConfig) SetInstance(instance *MsGraphInstance)
func (*MsGraphConfig) SetInstanceName ¶ added in v0.0.9
func (azConfig *MsGraphConfig) SetInstanceName(name string) error
type MsGraphGroupManager ¶ added in v0.0.9
type MsGraphGroupManager struct {
*MsGraph
}
func NewMsGraphGroupManager ¶ added in v0.0.9
func NewMsGraphGroupManager(ctx context.Context, cfg *MsGraphConfig) (*MsGraphGroupManager, error)
func (*MsGraphGroupManager) AddMembers ¶ added in v0.0.9
func (gm *MsGraphGroupManager) AddMembers(ctx context.Context, groupId string, userIds []string) error
Add member(s) to a group
func (*MsGraphGroupManager) DeleteGroup ¶ added in v0.0.9
func (gm *MsGraphGroupManager) DeleteGroup(ctx context.Context, groupId string) error
func (*MsGraphGroupManager) GetGroupId ¶ added in v0.0.11
func (*MsGraphGroupManager) GetGroupMembers ¶ added in v0.0.9
func (gm *MsGraphGroupManager) GetGroupMembers(ctx context.Context, grpId string) ([]*models.User, error)
Get all the members of a group. This returns partial users only, typically just the user id, name and email fields
func (*MsGraphGroupManager) GetUserGroups ¶ added in v0.0.9
func (gm *MsGraphGroupManager) GetUserGroups(ctx context.Context, uid string) ([]*cloudymodels.Group, error)
Get all the groups for a single user
func (*MsGraphGroupManager) ListGroups ¶ added in v0.0.9
func (gm *MsGraphGroupManager) ListGroups(ctx context.Context, filter string, attrs []string) (*[]models.Group, error)
List all the groups available
func (*MsGraphGroupManager) NewGroup ¶ added in v0.0.9
func (gm *MsGraphGroupManager) NewGroup(ctx context.Context, grp *models.Group) (*models.Group, error)
Create a new Group
func (*MsGraphGroupManager) RemoveMembers ¶ added in v0.0.9
func (gm *MsGraphGroupManager) RemoveMembers(ctx context.Context, groupId string, userIds []string) error
Remove members from a group
func (*MsGraphGroupManager) UpdateGroup ¶ added in v0.0.9
Update a group. This is generally just the name of the group.
type MsGraphGroupManagerFactory ¶ added in v0.0.2
type MsGraphGroupManagerFactory struct {
MsGraph
}
func (*MsGraphGroupManagerFactory) Create ¶ added in v0.0.2
func (ms *MsGraphGroupManagerFactory) Create(cfg interface{}) (cloudy.GroupManager, error)
func (*MsGraphGroupManagerFactory) FromEnv ¶ added in v0.0.5
func (ms *MsGraphGroupManagerFactory) FromEnv(env *cloudy.Environment) (interface{}, error)
type MsGraphInstance ¶ added in v0.0.9
type MsGraphInviteManager ¶ added in v0.0.11
type MsGraphInviteManager struct {
*MsGraph
}
func NewMsGraphInviteManager ¶ added in v0.0.11
func NewMsGraphInviteManager(ctx context.Context, cfg *MsGraphConfig) (*MsGraphInviteManager, error)
func (*MsGraphInviteManager) CreateInvitation ¶ added in v0.0.11
func (im *MsGraphInviteManager) CreateInvitation(ctx context.Context, user *cloudymodels.User, emailInvite bool, inviteRedirectUrl string) error
type MsGraphInviteManagerFactory ¶ added in v0.0.11
type MsGraphInviteManagerFactory struct {
MsGraph
}
func (*MsGraphInviteManagerFactory) Create ¶ added in v0.0.11
func (ms *MsGraphInviteManagerFactory) Create(cfg interface{}) (cloudy.InviteManager, error)
func (*MsGraphInviteManagerFactory) FromEnv ¶ added in v0.0.11
func (ms *MsGraphInviteManagerFactory) FromEnv(env *cloudy.Environment) (interface{}, error)
type MsGraphLicenseManager ¶ added in v0.0.9
type MsGraphLicenseManager struct {
*MsGraph
}
func NewMsGraphLicenseManager ¶ added in v0.0.2
func NewMsGraphLicenseManager(ctx context.Context, cfg *MsGraphConfig) (*MsGraphLicenseManager, error)
func (*MsGraphLicenseManager) AssignLicense ¶ added in v0.0.9
func (*MsGraphLicenseManager) GetAssigned ¶ added in v0.0.9
func (lm *MsGraphLicenseManager) GetAssigned(ctx context.Context, licenseSku string) ([]*cloudymodels.User, error)
GetAssigned gets a list of all the users with licenses https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(s:s/skuId eq 184efa21-98c3-4e5d-95ab-d07053a96e67) SEE : https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter
func (*MsGraphLicenseManager) GetUserAssigned ¶ added in v0.0.9
func (lm *MsGraphLicenseManager) GetUserAssigned(ctx context.Context, uid string) ([]*license.LicenseDescription, error)
func (*MsGraphLicenseManager) ListLicenses ¶ added in v0.0.9
func (lm *MsGraphLicenseManager) ListLicenses(ctx context.Context) ([]*license.LicenseDescription, error)
ListLicenses List all the managed licenses
func (*MsGraphLicenseManager) RemoveLicense ¶ added in v0.0.9
type MsGraphLicenseManagerFactory ¶ added in v0.0.4
type MsGraphLicenseManagerFactory struct {
MsGraph
}
func (*MsGraphLicenseManagerFactory) Create ¶ added in v0.0.4
func (lm *MsGraphLicenseManagerFactory) Create(cfg interface{}) (license.LicenseManager, error)
func (*MsGraphLicenseManagerFactory) FromEnv ¶ added in v0.0.5
func (lm *MsGraphLicenseManagerFactory) FromEnv(env *cloudy.Environment) (interface{}, error)
type MsGraphUserManager ¶ added in v0.0.9
type MsGraphUserManager struct {
*MsGraph
}
func NewMsGraphUserManager ¶ added in v0.0.2
func NewMsGraphUserManager(ctx context.Context, cfg *MsGraphConfig) (*MsGraphUserManager, error)
func NewMsGraphUserManagerFromEnv ¶ added in v0.0.9
func NewMsGraphUserManagerFromEnv(ctx context.Context, env *cloudy.Environment) (*MsGraphUserManager, error)
func (*MsGraphUserManager) AssocateCerificateMFA ¶ added in v0.0.9
func (um *MsGraphUserManager) AssocateCerificateMFA(ctx context.Context, uid string, certId string, replace bool) error
Associates a certificate ID as a second factor authentication
func (*MsGraphUserManager) DeleteUser ¶ added in v0.0.9
func (um *MsGraphUserManager) DeleteUser(ctx context.Context, uid string) error
func (*MsGraphUserManager) Disable ¶ added in v0.0.9
func (um *MsGraphUserManager) Disable(ctx context.Context, uid string) error
func (*MsGraphUserManager) Enable ¶ added in v0.0.9
func (um *MsGraphUserManager) Enable(ctx context.Context, uid string) error
func (*MsGraphUserManager) ForceUserName ¶ added in v0.0.9
func (*MsGraphUserManager) GetCertificateMFA ¶ added in v0.0.9
Associates a certificate ID as a second factor authentication
func (*MsGraphUserManager) GetProfilePicture ¶ added in v0.0.9
func (*MsGraphUserManager) GetUser ¶ added in v0.0.9
func (um *MsGraphUserManager) GetUser(ctx context.Context, uid string) (*cloudymodels.User, error)
func (*MsGraphUserManager) GetUserByEmail ¶ added in v0.0.11
func (um *MsGraphUserManager) GetUserByEmail(ctx context.Context, email string, opts *cloudy.UserOptions) (*cloudymodels.User, error)
func (*MsGraphUserManager) GetUserWithAttributes ¶ added in v0.0.26
func (um *MsGraphUserManager) GetUserWithAttributes(ctx context.Context, uid string, attrs []string) (*cloudymodels.User, error)
func (*MsGraphUserManager) ListUsers ¶ added in v0.0.9
func (um *MsGraphUserManager) ListUsers(ctx context.Context, filter string, attrs []string) (*[]cloudymodels.User, error)
func (*MsGraphUserManager) NewUser ¶ added in v0.0.9
func (um *MsGraphUserManager) NewUser(ctx context.Context, newUser *cloudymodels.User) (*cloudymodels.User, error)
func (*MsGraphUserManager) SetUserPassword ¶ added in v0.0.29
func (*MsGraphUserManager) UpdateUser ¶ added in v0.0.9
func (um *MsGraphUserManager) UpdateUser(ctx context.Context, usr *cloudymodels.User) error
func (*MsGraphUserManager) UploadProfilePicture ¶ added in v0.0.9
type MsGraphUserManagerFactory ¶ added in v0.0.2
type MsGraphUserManagerFactory struct {
MsGraph
}
func (*MsGraphUserManagerFactory) Create ¶ added in v0.0.2
func (umf *MsGraphUserManagerFactory) Create(cfg interface{}) (cloudy.UserManager, error)
func (*MsGraphUserManagerFactory) FromEnv ¶ added in v0.0.5
func (umf *MsGraphUserManagerFactory) FromEnv(env *cloudy.Environment) (interface{}, error)
type UserCustomSecurityAttributes ¶ added in v0.0.11
type UserCustomSecurityAttributes struct { AccountType string `json:"AccountType,omitempty"` Citizenship string `json:"Citizenship,omitempty"` ContractNumber string `json:"ContractNumber,omitempty"` ContractExpirationDate string `json:"ContractExpirationDate,omitempty"` Justification string `json:"Justification,omitempty"` ProgramRole string `json:"ProgramRole,omitempty"` Sponsor string `json:"Sponsor,omitempty"` StatusReason string `json:"StatusReason,omitempty"` }