ome

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: AGPL-3.0 Imports: 14 Imported by: 8

README

libome

Ome library

Documentation

Index

Constants

View Source
const (
	MetaServiceCertificate = "service-certificate"
	MetaTokenVerifyingKey  = "token-verify-key"

	MetaApiAccessKey    = "api-access-credentials"
	MetaApiAccessSecret = "api-access-secret"
)

Variables

This section is empty.

Functions

func ContextWithCredentials

func ContextWithCredentials(ctx context.Context, c *Credentials) context.Context

func ContextWithJWT

func ContextWithJWT(ctx context.Context, j string) context.Context

func ContextWithOauth2Token

func ContextWithOauth2Token(ctx context.Context, token string) context.Context

func ContextWithProxyCredentials

func ContextWithProxyCredentials(ctx context.Context, credentials2 *ProxyCredentials) context.Context

func GRPCStream added in v1.0.0

func GRPCStream(ctx context.Context, ss grpc.ServerStream) grpc.ServerStream

func GetOauth2Token

func GetOauth2Token(ctx context.Context) string

func JWTFromContext

func JWTFromContext(ctx context.Context) string

func NewGRPCBasic

func NewGRPCBasic(user, password string) *gRPCClientBasic

func NewGRPCClientApiAccess

func NewGRPCClientApiAccess(key, secret string) *gRPCClientApiAccess

func NewGRPCClientJwt

func NewGRPCClientJwt(t string) *gRPCClientJwt

func NewGRPCProxy

func NewGRPCProxy(key, secret string) *gRPCProxyBasic

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c Config) *Client

func (Client) Info

func (c Client) Info() (*Info, error)

func (*Client) RegisterUserAttributeDefinition

func (c *Client) RegisterUserAttributeDefinition(attrDefs []*apppb.UserAttributeDefinition) error

func (Client) Verify

func (c Client) Verify(ctx context.Context, t *authpb.JWT) (authpb.JWTState, error)

type Config

type Config struct {
	Address             string
	CertificateFilename string
	Key                 string
	Secret              string
}

type Credentials

type Credentials struct {
	Username string
	Password string
}

func CredentialsFromContext

func CredentialsFromContext(ctx context.Context) *Credentials

type CredentialsVerifyFunc

type CredentialsVerifyFunc func(cred *Credentials) (bool, error)

type DataService

type DataService struct {
	GRPC string `json:"grpc"`
	HTTP string `json:"http"`
}

type Endpoints

type Endpoints struct {
	Authorize string `json:"authorize"`
	Token     string `json:"token"`
	Revoke    string `json:"revoke"`
	Verify    string `json:"verify"`
}

type Info

type Info struct {
	Registration string       `json:"registration"`
	CSR          string       `json:"csr"`
	Data         DataService  `json:"data"`
	Oauth2       Oauth2Config `json:"oauth2"`
}

func GetInfo

func GetInfo(host string, certFilename string) (*Info, error)

GetInfo retrieves Ome services info

type Oauth2Config

type Oauth2Config struct {
	Endpoints    Endpoints `json:"endpoints"`
	SignatureKey string    `json:"signature_key"`
}

type ProxyCredentials

type ProxyCredentials struct {
	Key    string
	Secret string
}

func ProxyCredentialsFromContext

func ProxyCredentialsFromContext(ctx context.Context) *ProxyCredentials

type ProxyCredentialsVerifyFunc

type ProxyCredentialsVerifyFunc func(cred *ProxyCredentials) (bool, error)

Directories

Path Synopsis
proto
accounts
Package accountspb is a reverse proxy.
Package accountspb is a reverse proxy.
app
Package apppb is a reverse proxy.
Package apppb is a reverse proxy.
auth
Package authpb is a reverse proxy.
Package authpb is a reverse proxy.
ca
Package capb is a reverse proxy.
Package capb is a reverse proxy.
data
Package datapb is a reverse proxy.
Package datapb is a reverse proxy.
files
Package filespb is a reverse proxy.
Package filespb is a reverse proxy.
service
Package pb is a reverse proxy.
Package pb is a reverse proxy.
users
Package accountspb is a reverse proxy.
Package accountspb is a reverse proxy.

Jump to

Keyboard shortcuts

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