metadata

package
v10.294.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Client is a metadata client.

func NewClient

func NewClient(puContext string, 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.

Jump to

Keyboard shortcuts

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