ibmcloudappid

package
v0.0.0-...-8e5ec8a Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

README

App ID Mixer Adapter

Prototype of App ID integration with Istio.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppIDConfig

type AppIDConfig struct {
	// private fields should not be marshaled to json
	AppidURL          string             `json:"appidURL"`
	AppidAPIKey       string             `json:"-,"`
	ClusterInfo       *ClusterInfo       `json:"clusterInfo"`
	ClusterPolicies   *ClusterPolicies   `json:"clusterPolicies"`
	Port              string             `json:"port"`
	ClientCredentials *ClientCredentials `json:"clientCredentials"`
}

AppIDConfig encapsulates REST server configuration parameters

func NewAppIDConfig

func NewAppIDConfig() (*AppIDConfig, error)

NewAppIDConfig creates a configuration object

type AppidAdapter

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

AppidAdapter supports authorization template.

func (*AppidAdapter) Addr

func (s *AppidAdapter) Addr() string

Addr returns the listening address of the server

func (*AppidAdapter) Close

func (s *AppidAdapter) Close() error

Close gracefully shuts down the server; used for testing

func (*AppidAdapter) HandleAuthorization

HandleAuthorization handles web authentiation

func (*AppidAdapter) Run

func (s *AppidAdapter) Run(shutdown chan error)

Run starts the server run

type ClientCredentials

type ClientCredentials struct {
	TenantID         string `json:"tenantId"`
	ClientID         string `json:"clientId"`
	Secret           string `json:"-,"`
	AuthorizationURL string `json:"authorizationUrl"`
	TokenURL         string `json:"tokenUrl"`
	UserinfoURL      string `json:"userinfoUrl"`
	JwksURL          string `json:"jwksUrl"`
}

ClientCredentials encapsulates App ID instance credentials

type ClusterInfo

type ClusterInfo struct {
	Name     string             `json:"name"`
	GUID     string             `json:"guid"`
	Type     string             `json:"type"`
	Location string             `json:"location"`
	Services map[string]Service `json:"services,string"`
}

ClusterInfo encapsulates the Kubernetes cluster information to be sent to App ID

type ClusterPolicies

type ClusterPolicies struct {
	Services map[string]Service
}

ClusterPolicies encapsulates the policies retrieved from App ID

type JWTTokenParser

type JWTTokenParser interface {
	Parse(pubkeys map[string]crypto.PublicKey, token string) (*jwt.Token, error)
	Validate(pubkeys map[string]crypto.PublicKey, token string, tenantID string) error
}

JWTTokenParser parses and validates JWT tokens

type Monitor

type Monitor interface {
	Start()
	Stop() error
}

Monitor tracks kubernetes data with App ID

func NewMonitor

func NewMonitor(cfg *AppIDConfig) (Monitor, error)

NewMonitor creates an App ID Monitor object

type PublicKeyUtil

type PublicKeyUtil interface {
	RetrievePublicKeys() error
	GetPublicKeys() map[string]crypto.PublicKey
}

PublicKeyUtil retries public keys from OAuth server

func NewPublicKeyUtil

func NewPublicKeyUtil(publicKeyURL string) PublicKeyUtil

NewPublicKeyUtil Create a new Public Key Util

type Server

type Server interface {
	Addr() string
	Close() error
	Run(shutdown chan error)
}

Server is basic server interface

func NewAppIDAdapter

func NewAppIDAdapter(cfg *AppIDConfig) (Server, error)

NewAppIDAdapter creates a new AppID Adapter that listens at provided port.

type Service

type Service struct {
	Name                string `json:"name"`
	Namespace           string `json:"namespace"`
	IsProtectionEnabled bool   `json:"protectionEnabled"`
}

Service encapsulates a Kubernetes Service

Directories

Path Synopsis
Package config is a generated protocol buffer package.
Package config is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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