aadgroup

package
v0.0.0-...-7697e45 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GraphScope The OAuth2 scope used for dealing with MS Graph API
	GraphScope string = "https://graph.microsoft.com/.default"
)

Variables

This section is empty.

Functions

func AddUsers

func AddUsers(c *gin.Context)

AddUsers godoc @BasePath /aadgroup/api/v1 @Summary Add users to group @Schemes @Description Add a list of users to a group @Tags azuread group user @Accept multipart/form-data @Produce json @Param groupMembers formData GroupMembers true "The group members with group ObjectId" @Success 201 {boolean} true @Router /users [post]

func GetBearerToken

func GetBearerToken() (string, error)

GetBearerToken returns a token from Azure AD

func GetHealth

func GetHealth(c *gin.Context)

Health check verifies connectivity and login to Microsoft Graph API. GraphClient will kill the main process if it is not working.

func GetIndex

func GetIndex(c *gin.Context)

func GetUser

func GetUser(c *gin.Context)

GetUser godoc @BasePath /aadgroup/api/v1 @Summary Get user @Schemes @Description Return a single user based on User Principal Name @Tags azuread group user @Accept json @Produce json @Param upn path string true "User Principal Name" @Success 200 {object} employee @Router /user/{upn} [get]

func GetUsers

func GetUsers(c *gin.Context)

GetUsers godoc @BasePath /aadgroup/api/v1 @Summary Get list of users from group @Schemes @Description Return all users from a group @Tags azuread group user @Accept json @Produce json @Param groupObjectId path string false "Group ObjectId" @Success 200 {object} employee @Router /users/{groupObjectId} [get]

func RemoveUser

func RemoveUser(c *gin.Context)

RemoveUser godoc @BasePath /aadgroup/api/v1 @Summary Remove user from group @Schemes @Description Remove a single user from a group @Tags azuread group user @Accept multipart/form-data @Produce json @Param groupMember formData GroupMember true "The group member with group ObjectId" @Success 204 {string} No Content @Router /user [delete]

Types

type GraphError

type GraphError struct {
	Error struct {
		Code       string `json:"code"`
		Message    string `json:"message"`
		InnerError struct {
			Date            string `json:"date"`
			RequestID       string `json:"request-id"`
			ClientRequestID string `json:"client-request-id"`
		} `json:"innerError"`
	} `json:"error"`
}

type GroupMember

type GroupMember struct {
	GroupObjectId     string `json:"groupObjectId" form:"groupObjectId"`
	UserPrincipalName string `json:"userPrincipalName" form:"userPrincipalName" binding:"required"`
}

type GroupMembers

type GroupMembers struct {
	GroupObjectId      string   `json:"groupObjectId" form:"groupObjectId"`
	UserPrincipalNames []string `json:"userPrincipalNames" form:"userPrincipalNames" binding:"required"`
}

Jump to

Keyboard shortcuts

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