Back to

Package metadata

Latest Go to latest

The latest major version is .

Published: Jul 8, 2020 | License: Apache-2.0 | Module:


type Client

type Client struct {
	// contains filtered or unexported fields

Client is a metadata client.

func NewClient

func NewClient(puContext string, r *serviceregistry.Registry, t common.ServiceTokenIssuer) *Client

NewClient returns a new metadata client

func (*Client) Authorize

func (c *Client) Authorize(request *apiauth.Request) error

Authorize request will use the enforcerd databases and context to authorize an http request given the provided credentials.

func (*Client) GetCertificate

func (c *Client) GetCertificate() []byte

GetCertificate returns back the certificate.

func (*Client) GetCurrentPolicy

func (c *Client) GetCurrentPolicy() ([]byte, *policy.PUPolicyPublic, error)

GetCurrentPolicy returns the current policy of the datapath. It returns the marshalled policy as well as the original object for any farther processing.

func (*Client) GetPrivateKey

func (c *Client) GetPrivateKey() []byte

GetPrivateKey returns the private key associated with this service.

func (*Client) IssueToken

func (c *Client) IssueToken(ctx context.Context, stype common.ServiceTokenType, audience string, validity time.Duration) (string, error)

IssueToken issues an OAUTH token for this PU for the desired audience and validity. The request will use the token issuer to contact the OIDC provider and issue the token.

func (*Client) UpdateSecrets

func (c *Client) UpdateSecrets(cert, key []byte)

UpdateSecrets updates the secrets of the client.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier