Documentation ¶
Index ¶
Constants ¶
const ( CheckCredentialsEndpoint = "/credentials/check" AddCredentialsEndpoint = "/:id/credentials" )
const PutCredentialsEndpoint = "/{accountID}"
Variables ¶
This section is empty.
Functions ¶
func CheckV1 ¶
func CheckV1(logger *logrus.Logger) gin.HandlerFunc
@Summary Check credentials for validity @Description Non-authenticated endpoint Check credentials for validity. Returns an array of user objects with check result @Produce json @Param credentials body CheckCredentialsV1 true "Check credentials" @Success 200 {object} CheckUsersResultV1 @Fail 400 {object} gin.H @Fail 500 {object} gin.H @Router /credentials/check [post] @Tags credentials
func PutCredentialsV1 ¶
@Summary Add credentials to an account @Description Non-authenticated endpoint that adds grafana and confluence-server users to an account. Assumes entries are pre-validated @Produce json @Param account body SetCredentialsV1 true "Add credentials" @Success 200 {object} SetCredentialsV1 @Fail 404 {object} gin.H @Fail 500 {object} gin.H @Router /account/:id/credentials [put] @Tags account
Types ¶
type CheckCredentialsV1 ¶
type CheckCredentialsV1 struct { GrafanaReadUsers []CheckUserV1 `json:"GrafanaAPIUsers"` ConfluenceServerUsers []CheckUserV1 `json:"ConfluenceServerUsers"` }
CheckCredentialsV1 - Set of credentials to be validated
type CheckUserResultV1 ¶
type CheckUserResultV1 struct { Result bool Cause string `json:"Cause,omitempty"` CheckUserV1 }
CheckUserResultV1 - Grafana read user check result
type CheckUserV1 ¶
GrafanaUser - Grafana user with read access
func (CheckUserV1) GetFields ¶
func (u CheckUserV1) GetFields() logrus.Fields
type CheckUsersResultV1 ¶
type CheckUsersResultV1 struct { GrafanaReadUserCheck []CheckUserResultV1 ConfluenceServerUserCheck []CheckUserResultV1 }
CheckCredentialsResultV1 - Check credentials result
type SetCredentialsV1 ¶
type SetCredentialsV1 struct { GrafanaAPIUsers map[string]common.GrafanaUserV1 `json:"GrafanaAPIUsers"` ConfluenceServerUsers map[string]common.ConfluenceServerUserV1 `json:"ConfluenceServerUsers"` }
AddedCredentials - Users added to specified account
func (SetCredentialsV1) GetFields ¶
func (a SetCredentialsV1) GetFields() logrus.Fields
func (SetCredentialsV1) HasNoUsers ¶
func (req SetCredentialsV1) HasNoUsers() bool
HasNoUsers - returns true if both grafana and confluence user arrays are empty