client

package
v1.0.0-pre.8 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractExpiry

func ExtractExpiry(idToken string, deltaSeconds int) (*time.Time, error)

func NewClient

func NewClient(endpoint string, config Config) (*apiv1.ClientWithResponses, error)

NewClient provides an authenticated HTTP client for use with the arctir API

func NewOauthConfig

func NewOauthConfig(endpoint string) (*oauth2.Config, error)

func OidcClient

func OidcClient(config Config) (*http.Client, error)

Types

type Config

type Config struct {
	AuthEndpoint string `yaml:"authEndpoint,omitempty"`
	APIEndpoint  string `yaml:"apiEndpoint,omitempty"`
	AccessToken  string `yaml:"accessToken,omitempty"`
	RefreshToken string `yaml:"refreshToken,omitempty"`
	OrgName      string `yaml:"orgName,omitempty"`
}

func ReadConfig

func ReadConfig(path string) (*Config, error)

func (*Config) Save

func (c *Config) Save(configPath string) error

type OIDCConfig

type OIDCConfig struct {
	Config       oauth2.Config
	AccessToken  string
	RefreshToken string
}

func (OIDCConfig) NewClient

func (c OIDCConfig) NewClient() (*http.Client, error)

Jump to

Keyboard shortcuts

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