api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdHeader    = "x-brink-id"
	AuthHeader  = "x-brink-auth"
	KeyHeader   = "x-brink-api-key"
	TokenHeader = "x-brink-api-token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken struct {
	UserID         string    `json:"user_id"`
	Username       string    `json:"user_name"`
	Email          string    `json:"email"`
	Roles          []string  `json:"roles"`
	ExpirationTime time.Time `json:"exp"`
	Checksum       string    `json:"cs"`
}

type AuthenticationRequest

type AuthenticationRequest struct {
	Command   string `json:"command"`
	AuthToken string `json:"auth_token"`
	SessionId string `json:"session_id"`
}

type AuthenticationResponse

type AuthenticationResponse struct {
	AuthUrl      string `json:"auth_url"`
	AuthToken    string `json:"auth_token"`
	SessionToken string `json:"session_token"`
}

type CreateSessionRequest

type CreateSessionRequest struct {
	Target string `json:"target"`
}

type KeyResponse

type KeyResponse struct {
	Key string `json:"key"`
}

type MessageResponse

type MessageResponse struct {
	Message string `json:"message"`
}

type Policy

type Policy struct {
	Subs    []string `json:"subs"`
	Emails  []string `json:"emails"`
	Filters []string `json:"filters"`
}

type RegisterSessionRequest

type RegisterSessionRequest struct {
	SessionId  string            `json:"session_id"`
	SessionKey string            `json:"session_key"`
	Policies   map[string]Policy `json:"policies"`
	Target     string            `json:"target"`
	Checksum   string            `json:"cs"`
}

type SessionResponse

type SessionResponse struct {
	SessionId string `json:"session_id"`
}

type SessionToken

type SessionToken struct {
	UserID         string    `json:"user_id"`
	Username       string    `json:"user_name"`
	Email          string    `json:"email"`
	Roles          []string  `json:"roles"`
	Target         string    `json:"target"`
	ExpirationTime time.Time `json:"exp"`
	Checksum       string    `json:"cs"`
}

type Token

type Token struct {
	ExpirationTime time.Time `json:"exp"`
}

Jump to

Keyboard shortcuts

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