client

package module
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

Go Reference Go Report Card Test Status

Official go client for the Pomerium Enterprise API.

Install

go get -u github.com/pomerium/enterprise-client-go

Usage

Enterprise Setup

Example

Reference

gRPC API Reference

godocs

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizationHeader

func AuthorizationHeader(token string) string

AuthorizationHeader turns a service account token into the correct format for the Authorization header

Types

type Client

type Client struct {
	ActivityLogService            pb.ActivityLogServiceClient
	DeviceService                 pb.DeviceServiceClient
	KeyChainService               pb.KeyChainServiceClient
	NamespacePermissionService    pb.NamespacePermissionServiceClient
	NamespaceService              pb.NamespaceServiceClient
	PolicyService                 pb.PolicyServiceClient
	PomeriumServiceAccountService pb.PomeriumServiceAccountServiceClient
	PomeriumSessionService        pb.PomeriumSessionServiceClient
	RouteService                  pb.RouteServiceClient
	SettingsService               pb.SettingsServiceClient
	UserService                   pb.UserServiceClient
	// contains filtered or unexported fields
}

Client provides a wrapper interface for all API calls

func NewClient

func NewClient(ctx context.Context, target string, authToken string, opts ...Option) (*Client, error)

NewClient returns a Pomerium Enterprise client configured to communicate with a given target API

type Option

type Option func(*options)

func WithDialOption

func WithDialOption(o grpc.DialOption) Option

WithDialOption provides a custom grpc.DialOption to the internal grpc client in Client

func WithTlsConfig

func WithTlsConfig(config *tls.Config) Option

WithTlsConfig provides a custom tls.Config to the Client

type PomeriumAuthCredentials

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

PomeriumAuthCredentials implements grpc.PerRPCCredentials for communication with Pomerium Enterprise

func NewPomeriumAuthCredentials

func NewPomeriumAuthCredentials(authToken string) *PomeriumAuthCredentials

NewPomeriumAuthCredentials returns a new PomeriumAuthCredentials for the provided service account authToken

func (*PomeriumAuthCredentials) GetRequestMetadata

func (p *PomeriumAuthCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (*PomeriumAuthCredentials) RequireTransportSecurity

func (p *PomeriumAuthCredentials) RequireTransportSecurity() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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