plugin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ADMIN_ORG_WIDE_POLICY1 = `path "openhorizon/data/%s/*" {capabilities = ["create", "update", "read"]}`

Openhorizon org admins will have these ACL policies attached.

View Source
const ADMIN_ORG_WIDE_POLICY2 = `path "openhorizon/metadata/%s/*" {capabilities = ["list", "read", "delete"]}`
View Source
const ADMIN_POLICY_NAME = `openhorizon-%s-%s-admin`
View Source
const AGBOTID_RENEW_SECRET = "agbotid"
View Source
const AGBOTPW_RENEW_SECRET = "password"
View Source
const AGBOT_POLICY = `path "openhorizon/*" {capabilities = ["list","read"]}`

Openhorizon agbots will have these ACL policies attached.

View Source
const AGBOT_POLICY_NAME = `openhorizon-agbot`

Policy name formats

View Source
const AGBOT_RENEWAL_KEY = "agbot-renewal"
View Source
const AUTH_TOKEN_KEY = "token"
View Source
const AUTH_USER_KEY = "id"
View Source
const CONFIG_AGBOT_RENEWAL_KEY = "renewal"
View Source
const CONFIG_EXCHANGE_URL_KEY = "url"
View Source
const CONFIG_TOKEN_KEY = "token"
View Source
const CONFIG_VAULT_API_KEY = "apiurl"
View Source
const DEFAULT_APIURL = "http://localhost:8200"
View Source
const DEFAULT_RENEWAL_RATE = 300
View Source
const EXCHANGE_URL_STORAGE_KEY = "exchange-url"
View Source
const EX_MAX_RETRY = 5

TODO: Make these config options.

View Source
const EX_RETRY_INTERVAL = 2
View Source
const EX_ROOT_USER = "root"

The exchange root user id.

View Source
const HUB_CERT_PATH = "/openhorizon/certs/hub.crt"
View Source
const NON_ADMIN_ORG_WIDE_POLICY = `path "openhorizon/metadata/%s/*" {capabilities = ["list", "read"]}`

Regular openhorizon users will have these ACL policies attached. note: USER_PRIVATE_DENY_POLICY1 is also given to admins to prevent them from being able to read other user's private secrets

View Source
const USER_POLICY_NAME = `openhorizon-%s-%s`
View Source
const USER_PRIVATE_DENY_POLICY1 = `path "openhorizon/data/%s/user/*" {capabilities = ["deny"]}`
View Source
const USER_PRIVATE_DENY_POLICY2 = `path "openhorizon/metadata/%s/user/*" {capabilities = ["deny"]}`
View Source
const USER_PRIVATE_POLICY1 = `path "openhorizon/data/%s/user/%s/*" {capabilities = ["create", "update", "read"]}`

All supported openhorizon users will have these policies attached.

View Source
const USER_PRIVATE_POLICY2 = `path "openhorizon/metadata/%s/user/%s/*" {capabilities = ["list", "read", "delete"]}`
View Source
const VAULT_APIURL_STORAGE_KEY = "vault-url"
View Source
const VAULT_TOKEN_STORAGE_KEY = "agbot-vault-token"

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient() (*http.Client, error)

Create an https connection, using a supplied SSL CA certificate.

func OHAuthPlugin

func OHAuthPlugin(c *logical.BackendConfig) *ohAuthPlugin

Types

type Agbot

type Agbot struct {
	Token         string `json:"token"`
	Name          string `json:"name"`
	Owner         string `json:"owner"`
	MsgEndPoint   string `json:"msgEndPoint"`
	LastHeartbeat string `json:"lastHeartbeat"`
	PublicKey     []byte `json:"publicKey"`
}

type GetAgbotsResponse

type GetAgbotsResponse struct {
	Agbots    map[string]Agbot `json:"agbots"`
	LastIndex int              `json:"lastIndex"`
}

type GetUsersResponse

type GetUsersResponse struct {
	Users     map[string]UserDefinition `json:"users"`
	LastIndex int                       `json:"lastIndex"`
}

type NotAuthenticatedError

type NotAuthenticatedError struct {
	Msg string
}

func (NotAuthenticatedError) Error

func (e NotAuthenticatedError) Error() string

type OtherError

type OtherError struct {
	Msg string
}

func (OtherError) Error

func (e OtherError) Error() string

type UserDefinition

type UserDefinition struct {
	Password    string `json:"password"`
	Admin       bool   `json:"admin"`
	HubAdmin    bool   `json:"hubAdmin"`
	Email       string `json:"email"`
	LastUpdated string `json:"lastUpdated,omitempty"`
}

Jump to

Keyboard shortcuts

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