v1beta1

package
v0.0.0-...-2c12420 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsJWTTokenExpired

func IsJWTTokenExpired(accessToken string) (bool, time.Time)

func WithBearerToken

func WithBearerToken(token string) grpc.CallOption

WithBearerToken returns a grpc.CallOption that adds a standard HTTP Bearer token to all requests sent from a client.

func WithInsecureBearerToken

func WithInsecureBearerToken(token string) grpc.CallOption

WithInsecureBearerToken returns a grpc.CallOption that adds a standard HTTP Bearer token to all requests sent from an insecure client.

Must be used in conjunction with `insecure.NewCredentials()`.

Types

type ClientOptions

type ClientOptions func(*Config)

func WithAuthEnabled

func WithAuthEnabled(clientId string, clientSecret string, authServerTokenUrl string) ClientOptions

func WithHTTPTLSConfig

func WithHTTPTLSConfig(tlsConfig *tls.Config) ClientOptions

func WithHTTPUrl

func WithHTTPUrl(url string) ClientOptions

func WithTLSInsecure

func WithTLSInsecure(insecure bool) ClientOptions

func WithgRPCUrl

func WithgRPCUrl(url string) ClientOptions

type Config

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

func NewConfig

func NewConfig(options ...func(*Config)) *Config

type Inventory

type Inventory interface{}

type InventoryClient

type InventoryClient struct {
	K8sClusterService                              kessel.KesselK8SClusterServiceClient
	K8SPolicyIsPropagatedToK8SClusterServiceClient kesselrel.KesselK8SPolicyIsPropagatedToK8SClusterServiceClient
	PolicyServiceClient                            kessel.KesselK8SPolicyServiceClient
	RhelHostServiceClient                          kessel.KesselRhelHostServiceClient
	// contains filtered or unexported fields
}

func New

func New(config *Config) (*InventoryClient, error)

func (InventoryClient) GetTokenCallOption

func (a InventoryClient) GetTokenCallOption() ([]grpc.CallOption, error)

type InventoryHttpClient

type InventoryHttpClient struct {
	K8sClusterService                                  kessel.KesselK8SClusterServiceHTTPClient
	K8SPolicyIsPropagatedToK8SClusterServiceHTTPClient kesselrel.KesselK8SPolicyIsPropagatedToK8SClusterServiceHTTPClient
	PolicyServiceClient                                kessel.KesselK8SPolicyServiceHTTPClient
	RhelHostServiceClient                              kessel.KesselRhelHostServiceHTTPClient
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(ctx context.Context, config *Config) (*InventoryHttpClient, error)

func (InventoryHttpClient) GetTokenHTTPOption

func (a InventoryHttpClient) GetTokenHTTPOption() ([]http.CallOption, error)

type TokenClient

type TokenClient struct {
	EnableOIDCAuth bool
	Insecure       bool
	// contains filtered or unexported fields
}

func NewTokenClient

func NewTokenClient(config *Config) *TokenClient

NewTokenClient creates and returns a new TokenClient client.

func (*TokenClient) GetCachedToken

func (a *TokenClient) GetCachedToken(tokenKey string) (string, error)

func (*TokenClient) GetToken

func (a *TokenClient) GetToken() (*TokenResponse, error)

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

Jump to

Keyboard shortcuts

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