client

package
v1.32.2-hotfix.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: BSD-2-Clause Imports: 14 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TidepoolServerNameHeaderName   = "X-Tidepool-Server-Name"
	TidepoolServerSecretHeaderName = "X-Tidepool-Server-Secret"

	ServerSessionTokenTimeoutOnFailureFirst = 1 * time.Second
	ServerSessionTokenTimeoutOnFailureLast  = 60 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*External
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg *Config, authorizeAs platform.AuthorizeAs, name string, lgr log.Logger) (*Client, error)

func (*Client) CreateUserProviderSession

func (c *Client) CreateUserProviderSession(ctx context.Context, userID string, create *auth.ProviderSessionCreate) (*auth.ProviderSession, error)

func (*Client) CreateUserRestrictedToken

func (c *Client) CreateUserRestrictedToken(ctx context.Context, userID string, create *auth.RestrictedTokenCreate) (*auth.RestrictedToken, error)

func (*Client) DeleteAllProviderSessions added in v1.31.0

func (c *Client) DeleteAllProviderSessions(ctx context.Context, userID string) error

func (*Client) DeleteAllRestrictedTokens added in v1.31.0

func (c *Client) DeleteAllRestrictedTokens(ctx context.Context, userID string) error

func (*Client) DeleteProviderSession

func (c *Client) DeleteProviderSession(ctx context.Context, id string) error

func (*Client) DeleteRestrictedToken

func (c *Client) DeleteRestrictedToken(ctx context.Context, id string) error

func (*Client) GetProviderSession

func (c *Client) GetProviderSession(ctx context.Context, id string) (*auth.ProviderSession, error)

func (*Client) GetRestrictedToken

func (c *Client) GetRestrictedToken(ctx context.Context, id string) (*auth.RestrictedToken, error)

func (*Client) ListUserProviderSessions

func (c *Client) ListUserProviderSessions(ctx context.Context, userID string, filter *auth.ProviderSessionFilter, pagination *page.Pagination) (auth.ProviderSessions, error)

func (*Client) ListUserRestrictedTokens

func (c *Client) ListUserRestrictedTokens(ctx context.Context, userID string, filter *auth.RestrictedTokenFilter, pagination *page.Pagination) (auth.RestrictedTokens, error)

func (*Client) UpdateProviderSession

func (c *Client) UpdateProviderSession(ctx context.Context, id string, update *auth.ProviderSessionUpdate) (*auth.ProviderSession, error)

func (*Client) UpdateRestrictedToken

func (c *Client) UpdateRestrictedToken(ctx context.Context, id string, update *auth.RestrictedTokenUpdate) (*auth.RestrictedToken, error)

type Config

type Config struct {
	*platform.Config
	*ExternalConfig
}

func NewConfig

func NewConfig() *Config

func (*Config) Load

func (c *Config) Load(configReporter config.Reporter) error

func (*Config) Validate

func (c *Config) Validate() error

type External

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

func NewExternal

func NewExternal(cfg *ExternalConfig, authorizeAs platform.AuthorizeAs, name string, lgr log.Logger) (*External, error)

func (*External) Close

func (e *External) Close()

func (*External) EnsureAuthorized added in v1.29.0

func (e *External) EnsureAuthorized(ctx context.Context) error

func (*External) EnsureAuthorizedService added in v1.29.0

func (e *External) EnsureAuthorizedService(ctx context.Context) error

func (*External) EnsureAuthorizedUser added in v1.29.0

func (e *External) EnsureAuthorizedUser(ctx context.Context, targetUserID string, authorizedPermission string) (string, error)

func (*External) ServerSessionToken

func (e *External) ServerSessionToken() (string, error)

func (*External) Start

func (e *External) Start() error

func (*External) ValidateSessionToken

func (e *External) ValidateSessionToken(ctx context.Context, token string) (request.Details, error)

type ExternalConfig

type ExternalConfig struct {
	*platform.Config
	ServerSessionTokenSecret  string
	ServerSessionTokenTimeout time.Duration
}

func NewExternalConfig

func NewExternalConfig() *ExternalConfig

func (*ExternalConfig) Load

func (e *ExternalConfig) Load(configReporter config.Reporter) error

func (*ExternalConfig) Validate

func (e *ExternalConfig) Validate() error

Jump to

Keyboard shortcuts

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