dbx_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: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ScopeAccountInfoRead Read Dropbox account information
	ScopeAccountInfoRead = "account_info.read"

	// ScopeAccountInfoWrite Create, modify, and delete Dropbox account information
	ScopeAccountInfoWrite = "account_info.write"

	// ScopeFilesContentRead Read file data
	ScopeFilesContentRead = "files.content.read"

	// ScopeFilesContentWrite Create, modify, and delete file data
	ScopeFilesContentWrite = "files.content.write"

	// ScopeFilesMetadataRead Read file metadata
	ScopeFilesMetadataRead = "files.metadata.read"

	// ScopeFilesMetadataWrite Create, modify, and delete file metadata
	ScopeFilesMetadataWrite = "files.metadata.write"

	// ScopeFilesPermanentDelete Permanently delete files
	ScopeFilesPermanentDelete = "files.permanent_delete"

	// ScopeSharingRead Read sharing policies and memberships
	ScopeSharingRead = "sharing.read"

	// ScopeSharingWrite Create, modify, or delete sharing policies and memberships
	ScopeSharingWrite = "sharing.write"

	// ScopeFileRequestsRead Read a user's file requests
	ScopeFileRequestsRead = "file_requests.read"

	// ScopeFileRequestsWrite Create, modify, or delete a user's file requests
	ScopeFileRequestsWrite = "file_requests.write"

	// ScopeContactsWrite Delete a user's manually added contacts
	ScopeContactsWrite = "contacts.write"
)

Individual Scopes

View Source
const (
	// ScopeTeamInfoRead Read basic team settings
	ScopeTeamInfoRead = "team_info.read"

	// ScopeMembersRead Read team memberships and member settings
	ScopeMembersRead = "members.read"

	// ScopeMembersWrite Add, modify, and suspend team members
	ScopeMembersWrite = "members.write"

	// ScopeMembersDelete Delete team members
	ScopeMembersDelete = "members.delete"

	// ScopeGroupsRead Read groups and their memberships
	ScopeGroupsRead = "groups.read"

	// ScopeGroupsWrite Create, modify, and delete groups
	ScopeGroupsWrite = "groups.write"

	// ScopeSessionsList View linked web, device, and app sessions
	ScopeSessionsList = "sessions.list"

	// ScopeSessionsModify Unlink web, device, and app sessions
	ScopeSessionsModify = "sessions.modify"

	// ScopeTeamDataMember Access data of other team members
	ScopeTeamDataMember = "team_data.member"

	// ScopeTeamDataTeamSpace Manage the team space
	ScopeTeamDataTeamSpace = "team_data.team_space"

	// ScopeEventsRead Read the team event log
	ScopeEventsRead = "events.read"
)

Team Scopes

Variables

View Source
var (
	ErrorNoAuthDefined = errors.New("no auth defined")
)

Functions

func DropboxOAuthEndpoint

func DropboxOAuthEndpoint() oauth2.Endpoint

func IsTeamScope

func IsTeamScope(scope string) bool

func NewConsoleNoAuth

func NewConsoleNoAuth(peerName string) api_auth.Console

func NewLegacyApp

func NewLegacyApp(ctl app_control.Control) api_auth.App

func NewMock

func NewMock(peerName string) api_auth.Console

func NewMockWithPreset

func NewMockWithPreset(peerName string, preset map[string]*oauth2.Token) api_auth.Console

func NewScopedIndividual

func NewScopedIndividual(ctl app_control.Control) api_auth.App

func NewScopedTeam

func NewScopedTeam(ctl app_control.Control) api_auth.App

Types

type Legacy

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

func (*Legacy) Config

func (z *Legacy) Config(scopes []string) *oauth2.Config

func (*Legacy) UsePKCE

func (z *Legacy) UsePKCE() bool

type MockConsoleAuth

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

func (*MockConsoleAuth) Auth

func (z *MockConsoleAuth) Auth(scopes []string) (token api_auth.Context, err error)

func (*MockConsoleAuth) PeerName

func (z *MockConsoleAuth) PeerName() string

type MockContext

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

func (*MockContext) Config

func (z *MockContext) Config() *oauth2.Config

func (*MockContext) Description

func (z *MockContext) Description() string

func (*MockContext) IsNoAuth

func (z *MockContext) IsNoAuth() bool

func (*MockContext) PeerName

func (z *MockContext) PeerName() string

func (*MockContext) Scopes

func (z *MockContext) Scopes() []string

func (*MockContext) Supplemental

func (z *MockContext) Supplemental() string

func (*MockContext) Token

func (z *MockContext) Token() *oauth2.Token

type NoAuth

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

func (*NoAuth) Auth

func (z *NoAuth) Auth(scopes []string) (tc api_auth.Context, err error)

func (*NoAuth) PeerName

func (z *NoAuth) PeerName() string

type Scoped

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

func (Scoped) Config

func (z Scoped) Config(scopes []string) *oauth2.Config

func (Scoped) UsePKCE

func (z Scoped) UsePKCE() bool

Jump to

Keyboard shortcuts

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