client

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppRegistrationPath    = "applications"
	AppRegistrationPathGet = AppRegistrationPath + "/%s"
)
View Source
const (
	AppRegistrationOwnerPath       = "applications/%s/owners"
	AppRegistrationOwnerPathCreate = AppRegistrationOwnerPath + "/$ref"
	AppRegistrationOwnerPathDelete = AppRegistrationOwnerPath + "/%s/$ref"
)
View Source
const (
	FormEncoded              = "application/x-www-form-urlencoded"
	ApplicationJson          = "application/json"
	ApplicationXml           = "application/xml"
	IdSeparator              = ":"
	Basic                    = "Basic"
	Bearer                   = "Bearer"
	AzureGraphServer         = "graph.microsoft.com"
	AzureAuthServer          = "login.microsoftonline.com"
	ConsistencyLevel         = "ConsistencyLevel"
	ConsistencyLevelEventual = "eventual"
	Search                   = "$search"
	Top                      = "$top"
	MaxPageSize              = "999"
	SearchValue              = "\"%s:%s\""
	Filter                   = "$filter"
	FilterValue              = "%s eq '%s'"
	FilterAnd                = " and "
	Public                   = "Public"
	Private                  = "Private"
	WaitNotExists            = "NotExists"
	WaitFound                = "Found"
	WaitError                = "Error"
)
View Source
const (
	EnterpriseAppPath    = "servicePrincipals"
	EnterpriseAppPathGet = EnterpriseAppPath + "/%s"
	IntegratedApp        = "WindowsAzureActiveDirectoryIntegratedApp"
)
View Source
const (
	EnterpriseAppOwnerPath       = "servicePrincipals/%s/owners"
	EnterpriseAppOwnerPathCreate = EnterpriseAppOwnerPath + "/$ref"
	EnterpriseAppOwnerPathDelete = EnterpriseAppOwnerPath + "/%s/$ref"
)
View Source
const (
	EnterpriseAppRolePath              = "servicePrincipals/%s/appRoles"
	EnterpriseAppRoleDefaultAccessId   = "00000000-0000-0000-0000-000000000000"
	EnterpriseAppRoleDefaultAccessName = "Default Access"
)
View Source
const (
	GroupPath    = "groups"
	GroupPathGet = GroupPath + "/%s"
	Unified      = "Unified"
)
View Source
const (
	GroupMemberPath       = "groups/%s/members"
	GroupMemberPathCreate = GroupMemberPath + "/$ref"
	GroupMemberPathDelete = GroupMemberPath + "/%s/$ref"
)
View Source
const (
	GroupOwnerPath       = "groups/%s/owners"
	GroupOwnerPathCreate = GroupOwnerPath + "/$ref"
	GroupOwnerPathDelete = GroupOwnerPath + "/%s/$ref"
)
View Source
const (
	GroupRoleAssignmentPath    = "groups/%s/appRoleAssignments"
	GroupRoleAssignmentPathGet = GroupRoleAssignmentPath + "/%s"
)
View Source
const (
	UserPath    = "users"
	UserPathGet = UserPath + "/%s"
)
View Source
const (
	OauthTokenPath = "oauth/token"
)

Variables

This section is empty.

Functions

func AppRegistrationOwnerDecodeId added in v0.1.16

func AppRegistrationOwnerDecodeId(s string) (string, string)

func EnterpriseAppOwnerDecodeId added in v0.1.16

func EnterpriseAppOwnerDecodeId(s string) (string, string)

func EnterpriseAppRoleDecodeId added in v0.1.6

func EnterpriseAppRoleDecodeId(s string) (string, string)

func GroupMemberDecodeId added in v0.1.4

func GroupMemberDecodeId(s string) (string, string)

func GroupOwnerDecodeId added in v0.1.3

func GroupOwnerDecodeId(s string) (string, string)

func GroupRoleAssignmentDecodeId added in v0.1.6

func GroupRoleAssignmentDecodeId(s string) (string, string)

Types

type AppRegistration added in v0.1.5

type AppRegistration struct {
	Id          string `json:"id,omitempty"`
	AppId       string `json:"appId,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
}

type AppRegistrationCollection added in v0.1.5

type AppRegistrationCollection struct {
	AppRegistrations []AppRegistration `json:"value"`
}

type AppRegistrationOwner added in v0.1.16

type AppRegistrationOwner struct {
	AppRegistrationId string `json:"-"`
	OwnerId           string `json:"-"`
	OdataId           string `json:"@odata.id,omitempty"`
}

func (*AppRegistrationOwner) AppRegistrationOwnerEncodeId added in v0.1.16

func (arown *AppRegistrationOwner) AppRegistrationOwnerEncodeId() string

type AppRole added in v0.1.15

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

type AppRoles added in v0.1.15

type AppRoles struct {
	AppRoles []AppRole `json:"appRoles,omitempty"`
}

type Client

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

func NewClient

func NewClient(ctx context.Context, tenantId string, accessToken string, clientId string, clientSecret string) (client *Client, err error)

func (*Client) HttpRequest

func (c *Client) HttpRequest(ctx context.Context, method string, path string, query url.Values, headerMap http.Header, body *bytes.Buffer) (response *bytes.Buffer, err error)

func (*Client) RequestPath added in v0.1.3

func (c *Client) RequestPath(path string) string

type EnterpriseApp added in v0.1.5

type EnterpriseApp struct {
	Id          string    `json:"id,omitempty"`
	AppId       string    `json:"appId,omitempty"`
	DisplayName string    `json:"displayName,omitempty"`
	LoginUrl    string    `json:"loginUrl,omitempty"`
	LogoutUrl   string    `json:"logoutUrl,omitempty"`
	Tags        []string  `json:"tags,omitempty"`
	AppRoles    []AppRole `json:"appRoles"`
}

type EnterpriseAppCollection added in v0.1.5

type EnterpriseAppCollection struct {
	EnterpriseApps []EnterpriseApp `json:"value"`
}

type EnterpriseAppOwner added in v0.1.16

type EnterpriseAppOwner struct {
	EnterpriseAppId string `json:"-"`
	OwnerId         string `json:"-"`
	OdataId         string `json:"@odata.id,omitempty"`
}

func (*EnterpriseAppOwner) EnterpriseAppOwnerEncodeId added in v0.1.16

func (eaown *EnterpriseAppOwner) EnterpriseAppOwnerEncodeId() string

type EnterpriseAppRole added in v0.1.6

type EnterpriseAppRole struct {
	EnterpriseAppId string `json:"-"`
	Id              string `json:"id,omitempty"`
	DisplayName     string `json:"displayName,omitempty"`
	Description     string `json:"description,omitempty"`
}

func (*EnterpriseAppRole) EnterpriseAppRoleEncodeId added in v0.1.6

func (ear *EnterpriseAppRole) EnterpriseAppRoleEncodeId() string

type EnterpriseAppRoleCollection added in v0.1.6

type EnterpriseAppRoleCollection struct {
	EnterpriseAppRoles []EnterpriseAppRole `json:"value"`
}

type Group

type Group struct {
	Id              string   `json:"id,omitempty"`
	Description     string   `json:"description,omitempty"`
	DisplayName     string   `json:"displayName,omitempty"`
	GroupTypes      []string `json:"groupTypes,omitempty"`
	Mail            string   `json:"mail,omitempty"`
	MailEnabled     bool     `json:"mailEnabled"`
	MailNickname    string   `json:"mailNickname,omitempty"`
	SecurityEnabled bool     `json:"securityEnabled"`
	Visibility      string   `json:"visibility"`
	Owners          []string `json:"owners@odata.bind,omitempty"`
}

func (*Group) GroupIsPublic added in v0.1.11

func (grp *Group) GroupIsPublic() bool

type GroupCollection added in v0.1.8

type GroupCollection struct {
	Groups []Group `json:"value"`
}

type GroupMember added in v0.1.4

type GroupMember struct {
	GroupId  string `json:"-"`
	MemberId string `json:"-"`
	OdataId  string `json:"@odata.id,omitempty"`
}

func (*GroupMember) GroupMemberEncodeId added in v0.1.4

func (grpmem *GroupMember) GroupMemberEncodeId() string

type GroupOwner added in v0.1.3

type GroupOwner struct {
	GroupId string `json:"-"`
	OwnerId string `json:"-"`
	OdataId string `json:"@odata.id,omitempty"`
}

func (*GroupOwner) GroupOwnerEncodeId added in v0.1.3

func (grpown *GroupOwner) GroupOwnerEncodeId() string

type GroupRoleAssignment added in v0.1.6

type GroupRoleAssignment struct {
	GroupId     string `json:"-"`
	Id          string `json:"id,omitempty"`
	ResourceId  string `json:"resourceId,omitempty"`
	PrincipalId string `json:"principalId,omitempty"`
	AppRoleId   string `json:"appRoleId,omitempty"`
}

func (*GroupRoleAssignment) GroupRoleAssignmentEncodeId added in v0.1.6

func (gra *GroupRoleAssignment) GroupRoleAssignmentEncodeId() string

type OauthToken

type OauthToken struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    int    `json:"expires_in"`
	Scope        string `json:"scope"`
}

type RequestError

type RequestError struct {
	StatusCode int
	Err        error
}

func (*RequestError) Error

func (r *RequestError) Error() string

type User

type User struct {
	Id                string `json:"id,omitempty"`
	DisplayName       string `json:"displayName,omitempty"`
	GivenName         string `json:"givenName,omitempty"`
	Surname           string `json:"surname,omitempty"`
	JobTitle          string `json:"jobTitle,omitempty"`
	Mail              string `json:"mail,omitempty"`
	UserPrincipalName string `json:"userPrincipalName,omitempty"`
}

type UserCollection added in v0.1.2

type UserCollection struct {
	Users []User `json:"value"`
}

Jump to

Keyboard shortcuts

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