auth

package
v0.0.0-...-0edac8c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package auth handles the Realm GraphQL Server authentication. This consists of providing valid credentials to obtain a token. The token is refreshed every 30 minutes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	Token      *oauth2.Token // public so the application can use withExtra() to access device id or user_id
	// contains filtered or unexported fields
}

Client holds a http realm client

func NewClient

func NewClient(opts *options.ClientOptions) (*Client, error)

NewClient creates a new Client with endpoints to Realm based on the provided client options.

func (*Client) Connect

func (c *Client) Connect() error

Connect connects to realm and establishes http client with auto refresh Token

func (*Client) ConnectWithToken

func (c *Client) ConnectWithToken(t *oauth2.Token) error

ConnectWithToken connect to realm with an existing token, either user-provided or internally obtained. Then token needs to be valid for the client to work.

func (*Client) Ping

func (c *Client) Ping() error

Ping assumes an http service named "ping" with an incoming_webhook calling a function named "test" which returns 200 has been created.

Jump to

Keyboard shortcuts

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