Documentation ¶
Index ¶
- type Client
- func (c *Client) Authorize(request *apiauth.Request) error
- func (c *Client) GetCertificate() []byte
- func (c *Client) GetCurrentPolicy() ([]byte, *policy.PUPolicyPublic, error)
- func (c *Client) GetPrivateKey() []byte
- func (c *Client) IssueToken(ctx context.Context, stype common.ServiceTokenType, audience string, ...) (string, error)
- func (c *Client) UpdateSecrets(cert, key []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a metadata client.
func NewClient ¶
func NewClient(puContext string, t common.ServiceTokenIssuer) *Client
NewClient returns a new metadata client
func (*Client) Authorize ¶
Authorize request will use the enforcerd databases and context to authorize an http request given the provided credentials.
func (*Client) GetCertificate ¶
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 ¶
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 ¶
UpdateSecrets updates the secrets of the client.