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: 3

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