auth

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CredentialsEndpoint = "api/v1/credentials"
View Source
const GroupsEndpoint = "api/v1/groups"
View Source
const RolesEndpoint = "api/v1/rbac/roles"
View Source
const UsersEndpoint = "api/v1/users"

Variables

This section is empty.

Functions

func CreateGroup

func CreateGroup(c api.Client, group Group) error

Create a new group.

func CreateRole

func CreateRole(c api.Client, role Role) error

Create a new role.

func CreateUser

func CreateUser(c api.Client, user User) error

Create a new user.

func DeleteCredential

func DeleteCredential(c api.Client, name string) error

Delete an existing credential.

func DeleteGroup

func DeleteGroup(c api.Client, name string) error

Delete an existing group.

func DeleteRole

func DeleteRole(c api.Client, name string) error

Delete an existing role.

func DeleteUser

func DeleteUser(c api.Client, name string) error

Delete an existing user.

func UpdateCredential

func UpdateCredential(c api.Client, credential Credential) error

Create a new or update an existing credential.

func UpdateGroup

func UpdateGroup(c api.Client, group Group) error

Update an existing group.

func UpdateRole

func UpdateRole(c api.Client, role Role) error

Update an existing role.

func UpdateUser

func UpdateUser(c api.Client, user User) error

Update an existing user.

Types

type Credential

type Credential struct {
	Id                     string           `json:"_id,omitempty"`
	AccountGUID            string           `json:"accountGUID,omitempty"`
	AccountID              string           `json:"accountID,omitempty"`
	ApiToken               Secret           `json:"apiToken,omitempty"`
	CaCert                 string           `json:"caCert,omitempty"`
	Created                string           `json:"created,omitempty"`
	Description            string           `json:"description,omitempty"`
	External               bool             `json:"external,omitempty"`
	LastModified           string           `json:"lastModified,omitempty"`
	Owner                  string           `json:"owner,omitempty"`
	RoleArn                string           `json:"roleArn,omitempty"`
	Secret                 Secret           `json:"secret,omitempty"`
	SkipVerify             bool             `json:"skipVerify,omitempty"`
	Tokens                 []TemporaryToken `json:"tokens,omitempty"`
	Type                   string           `json:"type,omitempty"`
	Url                    string           `json:"url,omitempty"`
	UseAWSRole             bool             `json:"useAWSRole,omitempty"`
	UseSTSRegionalEndpoint bool             `json:"useSTSRegionalEndpoint,omitempty"`
}

func GetCredential

func GetCredential(c api.Client, name string) (*Credential, error)

Get a specific credential.

func ListCredentials

func ListCredentials(c api.Client) ([]Credential, error)

Get all credentials.

type Group

type Group struct {
	Id          string            `json:"groupId,omitempty"` // Group identifier in the Azure SAML identification process.
	LdapGroup   bool              `json:"ldapGroup,omitempty"`
	Name        string            `json:"groupName,omitempty"`
	OauthGroup  bool              `json:"oauthGroup,omitempty"`
	OidcGroup   bool              `json:"oidcGroup,omitempty"`
	Permissions []GroupPermission `json:"permissions,omitempty"`
	Role        string            `json:"role,omitempty"`
	SamlGroup   bool              `json:"samlGroup,omitempty"`
	Users       []GroupUser       `json:"user,omitempty"`
}

func GetGroup

func GetGroup(c api.Client, name string) (*Group, error)

Get a specific group.

func ListGroups

func ListGroups(c api.Client) ([]Group, error)

Get all groups.

type GroupPermission

type GroupPermission struct {
	Collections []string `json:"collections,omitempty"`
	Project     string   `json:"project,omitempty"`
}

type GroupUser

type GroupUser struct {
	Username string `json:"username,omitempty"`
}

type Role

type Role struct {
	Description string           `json:"description,omitempty"`
	Name        string           `json:"name,omitempty"`
	Permissions []RolePermission `json:"perms,omitempty"`
}

func GetRole

func GetRole(c api.Client, name string) (*Role, error)

Get a specific role.

func ListRoles

func ListRoles(c api.Client) ([]Role, error)

Get all roles.

type RolePermission

type RolePermission struct {
	Name      string `json:"name,omitempty"`
	ReadWrite bool   `json:"readWrite,omitempty"`
}

type Secret

type Secret struct {
	Encrypted string `json:"encrypted,omitempty"`
	Plain     string `json:"plain,omitempty"`
}

type TemporaryToken

type TemporaryToken struct {
	AwsAccessKeyId     string `json:"awsAccessKeyId,omitempty"`
	AwsSecretAccessKey Secret `json:"awsSecretAccessKey,omitempty"`
	Duration           int    `json:"duration,omitempty"`
	ExpirationTime     string `json:"expirationTime,omitempty"`
	Token              Secret `json:"token,omitempty"`
}

type User

type User struct {
	AuthType    string           `json:"authType,omitempty"`
	Password    string           `json:"password,omitempty"`
	Permissions []UserPermission `json:"permissions,omitempty"`
	Role        string           `json:"role,omitempty"`
	Username    string           `json:"username,omitempty"`
}

func GetUser

func GetUser(c api.Client, name string) (*User, error)

Get a specific user.

func ListUsers

func ListUsers(c api.Client) ([]User, error)

Get all users.

type UserPermission

type UserPermission struct {
	Collections []string `json:"collections,omitempty"`
	Project     string   `json:"project,omitempty"`
}

Jump to

Keyboard shortcuts

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