credentials

package
v0.0.0-...-41b1600 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckCredentialsEndpoint = "/credentials/check"
	AddCredentialsEndpoint   = "/:id/credentials"
)
View Source
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

func PutCredentialsV1(logger *logrus.Logger, aeroClient *as.ASClient) gin.HandlerFunc

@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

type CheckUserV1 struct {
	Auth common.Auth
	Host string
	Port int
}

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

Jump to

Keyboard shortcuts

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