api_auth

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DropboxTokenFull               = "user_full"
	DropboxTokenApp                = "user_app"
	DropboxTokenBusinessInfo       = "business_info"
	DropboxTokenBusinessAudit      = "business_audit"
	DropboxTokenBusinessFile       = "business_file"
	DropboxTokenBusinessManagement = "business_management"
	DropboxScopedIndividual        = "dropbox_scoped_individual"
	DropboxScopedTeam              = "dropbox_scoped_team"
	Github                         = "github"
	GoogleMail                     = "google_mail"
	GoogleSheets                   = "google_sheets"
	Asana                          = "asana"
	Slack                          = "slack"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	// Config OAuth2 config
	Config(scope []string) *oauth2.Config

	// UsePKCE Use PKCE on authentication
	UsePKCE() bool
}

App OAuth Application key/secret manager

type AuthType

type AuthType struct {
	Type   string   `json:"type"`
	Scopes []string `json:"scopes"`
}

func (AuthType) Id

func (z AuthType) Id() string

type Basic

type Basic interface {
	PeerName() string
}

Basic is for Basic Authentication interface

type Console

type Console interface {
	PeerName() string

	Auth(scope []string) (token Context, err error)
}

Console OAuth interface for console UI

type Context

type Context interface {
	Config() *oauth2.Config
	Token() *oauth2.Token
	Scopes() []string
	PeerName() string
	Description() string
	Supplemental() string
	IsNoAuth() bool
}

Auth context

func NewContext

func NewContext(token *oauth2.Token, cfg *oauth2.Config, peerName string, scopes []string) Context

func NewContextWithAttr

func NewContextWithAttr(c Context, cfg *oauth2.Config, desc, suppl string) Context

func NewNoAuth

func NewNoAuth() Context

type Repository

type Repository interface {
	List(ct AuthType) (peers []Context, err error)

	Set(ct AuthType, peer Context) (err error)

	Get(ct AuthType, peerName string) (peer Context, err error)

	Delete(ct AuthType, peerName string) (err error)
}

Jump to

Keyboard shortcuts

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