api

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 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"

	UpgradeHeaderValue  = "x-brink-protocol"
	HandshakeHeaderName = "x-brink-handshake-key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

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

type CreateSessionRequest

type CreateSessionRequest struct {
	AuthToken string `json:"auth_token,omitempty"`
	Target    string `json:"target,omitempty"`
}

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,omitempty"`
	Emails  []string `json:"emails,omitempty"`
	Filters []string `json:"filters,omitempty"`
}

type RegisterSessionRequest

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

type SessionToken

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

type SessionTokenRequest added in v0.2.0

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

type SessionTokenResponse added in v0.2.0

type SessionTokenResponse struct {
	SessionId    string `json:"session_id,omitempty"`
	AuthUrl      string `json:"auth_url,omitempty"`
	AuthToken    string `json:"auth_token,omitempty"`
	SessionToken string `json:"session_token,omitempty"`
}

type Token

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

Jump to

Keyboard shortcuts

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