Documentation ¶
Index ¶
Constants ¶
const ( CreateDapp string = "create:dapp" CreateChannel string = "create:channel" CreateType string = "create:type" CreateAlias string = "create:alias" CreateBroker string = "create:broker" GetDapp string = "get:dapp" GetChannel string = "get:channel" GetType string = "get:type" GetAlias string = "get:alias" GetBroker string = "get:broker" UpdateDapp string = "update:dapp" UpdateChannel string = "update:channel" UpdateType string = "update:type" UpdateAlias string = "update:alias" DeleteDapp string = "delete:dapp" DeleteChannel string = "delete:channel" DeleteType string = "delete:type" DeleteAlias string = "delete:alias" CreateToken string = "create:token" )
All Permissions possible values
Variables ¶
var AdminPermissions = map[string][]string{ CreateAlias: {""}, DeleteAlias: {""}, GetAlias: {""}, UpdateAlias: {""}, CreateChannel: {""}, DeleteChannel: {""}, GetChannel: {""}, UpdateChannel: {""}, CreateDapp: {""}, DeleteDapp: {""}, GetDapp: {""}, UpdateDapp: {""}, CreateType: {""}, DeleteType: {""}, GetType: {""}, UpdateType: {""}, GetBroker: nil, CreateBroker: nil, CreateToken: nil, }
AdminPermissions defines all the permissions that the admin user have when the cluster is initialized
Functions ¶
func GetPublicKey ¶
GetPublicKey resolves the rsa public key from the environment variable
Types ¶
type Auth ¶
type Auth interface { Validate(token []byte) (*Payload, []byte, error) Tokenize(load Payload) ([]byte, error) Init(key string, load Payload) ([]byte, error) Refresh(token []byte) ([]byte, error) }
Auth is the inteface for interacting with the Authentication service
type Authenticator ¶
type Authenticator struct {
TokenPath string
}
Authenticator is responsible for implementing the interface methods defined in the rest/request pkg.
func (Authenticator) GetToken ¶
func (a Authenticator) GetToken() ([]byte, error)
GetToken read the token from the file specified in the struct TokenPath and returns it's bytes
func (Authenticator) SetToken ¶
func (a Authenticator) SetToken(token []byte) error
SetToken receives a new token as a parameter and then writes it in the file specified in the TokenPath
type JwtDO ¶
type JwtDO struct {
Token []byte `json:"token"`
}
JwtDO is a data output type for master's token handler
type Payload ¶
type Payload struct { UID string `json:"uid"` // Permissions is a map where key is the Scope and values are permissions Permissions map[string][]string `json:"permissions"` Refresh []byte `json:"refresh"` RefreshURL string `json:"refreshurl"` }
Payload is information caried by a Inspr acceess token
func Desserialize ¶
Desserialize converts a token to a Payload model
func (*Payload) ImportPermissionList ¶ added in v0.1.4
ImportPermissionList converts Dapps auth permission scheme to paylod permissions
type ResfreshDO ¶
type ResfreshDO struct {
RefreshToken []byte `json:"refreshtoken"`
}
ResfreshDO is the body type expected by UID provider to refresh a payload