auth

package
v5.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package auth : has no documentation (yet)

Index

Constants

View Source
const (
	AccessErrorInvalidAccountType = "invalid_account_type"
	AccessErrorPaperAccessDenied  = "paper_access_denied"
	AccessErrorOther              = "other"
)

Valid tag values for AccessError

View Source
const (
	AuthErrorInvalidAccessToken = "invalid_access_token"
	AuthErrorInvalidSelectUser  = "invalid_select_user"
	AuthErrorInvalidSelectAdmin = "invalid_select_admin"
	AuthErrorUserSuspended      = "user_suspended"
	AuthErrorExpiredAccessToken = "expired_access_token"
	AuthErrorMissingScope       = "missing_scope"
	AuthErrorOther              = "other"
)

Valid tag values for AuthError

View Source
const (
	InvalidAccountTypeErrorEndpoint = "endpoint"
	InvalidAccountTypeErrorFeature  = "feature"
	InvalidAccountTypeErrorOther    = "other"
)

Valid tag values for InvalidAccountTypeError

View Source
const (
	PaperAccessErrorPaperDisabled = "paper_disabled"
	PaperAccessErrorNotPaperUser  = "not_paper_user"
	PaperAccessErrorOther         = "other"
)

Valid tag values for PaperAccessError

View Source
const (
	RateLimitReasonTooManyRequests        = "too_many_requests"
	RateLimitReasonTooManyWriteOperations = "too_many_write_operations"
	RateLimitReasonOther                  = "other"
)

Valid tag values for RateLimitReason

View Source
const (
	TokenFromOAuth1ErrorInvalidOauth1TokenInfo = "invalid_oauth1_token_info"
	TokenFromOAuth1ErrorAppIdMismatch          = "app_id_mismatch"
	TokenFromOAuth1ErrorOther                  = "other"
)

Valid tag values for TokenFromOAuth1Error

Variables

This section is empty.

Functions

func HandleCommonAuthErrors

func HandleCommonAuthErrors(c dropbox.Config, resp *http.Response, body []byte) error

HandleCommonAuthErrors handles common authentication errors

Types

type AccessAPIError

type AccessAPIError struct {
	dropbox.APIError
	AccessError *AccessError `json:"error"`
}

AccessAPIError wraps AccessError

type AccessError

type AccessError struct {
	dropbox.Tagged
	// InvalidAccountType : Current account type cannot access the resource.
	InvalidAccountType *InvalidAccountTypeError `json:"invalid_account_type,omitempty"`
	// PaperAccessDenied : Current account cannot access Paper.
	PaperAccessDenied *PaperAccessError `json:"paper_access_denied,omitempty"`
}

AccessError : Error occurred because the account doesn't have permission to access the resource.

func (*AccessError) UnmarshalJSON

func (u *AccessError) UnmarshalJSON(body []byte) error

UnmarshalJSON deserializes into a AccessError instance

type AuthAPIError

type AuthAPIError struct {
	dropbox.APIError
	AuthError *AuthError `json:"error"`
}

AuthAPIError wraps AuthError

type AuthError

type AuthError struct {
	dropbox.Tagged
	// MissingScope : The access token does not have the required scope to
	// access the route.
	MissingScope *TokenScopeError `json:"missing_scope,omitempty"`
}

AuthError : Errors occurred during authentication.

func (*AuthError) UnmarshalJSON

func (u *AuthError) UnmarshalJSON(body []byte) error

UnmarshalJSON deserializes into a AuthError instance

type Client

type Client interface {
	// TokenFromOauth1 : Creates an OAuth 2.0 access token from the supplied
	// OAuth 1.0 access token.
	TokenFromOauth1(arg *TokenFromOAuth1Arg) (res *TokenFromOAuth1Result, err error)
	// TokenRevoke : Disables the access token used to authenticate the call.
	TokenRevoke() (err error)
}

Client interface describes all routes in this namespace

func New

func New(c dropbox.Config) Client

New returns a Client implementation for this namespace

type InvalidAccountTypeError

type InvalidAccountTypeError struct {
	dropbox.Tagged
}

InvalidAccountTypeError : has no documentation (yet)

type PaperAccessError

type PaperAccessError struct {
	dropbox.Tagged
}

PaperAccessError : has no documentation (yet)

type RateLimitAPIError

type RateLimitAPIError struct {
	dropbox.APIError
	RateLimitError *RateLimitError `json:"error"`
}

RateLimitAPIError wraps RateLimitError

type RateLimitError

type RateLimitError struct {
	// Reason : The reason why the app is being rate limited.
	Reason *RateLimitReason `json:"reason"`
	// RetryAfter : The number of seconds that the app should wait before making
	// another request.
	RetryAfter uint64 `json:"retry_after"`
}

RateLimitError : Error occurred because the app is being rate limited.

func NewRateLimitError

func NewRateLimitError(Reason *RateLimitReason) *RateLimitError

NewRateLimitError returns a new RateLimitError instance

type RateLimitReason

type RateLimitReason struct {
	dropbox.Tagged
}

RateLimitReason : has no documentation (yet)

type TokenFromOAuth1Arg

type TokenFromOAuth1Arg struct {
	// Oauth1Token : The supplied OAuth 1.0 access token.
	Oauth1Token string `json:"oauth1_token"`
	// Oauth1TokenSecret : The token secret associated with the supplied access
	// token.
	Oauth1TokenSecret string `json:"oauth1_token_secret"`
}

TokenFromOAuth1Arg : has no documentation (yet)

func NewTokenFromOAuth1Arg

func NewTokenFromOAuth1Arg(Oauth1Token string, Oauth1TokenSecret string) *TokenFromOAuth1Arg

NewTokenFromOAuth1Arg returns a new TokenFromOAuth1Arg instance

type TokenFromOAuth1Error

type TokenFromOAuth1Error struct {
	dropbox.Tagged
}

TokenFromOAuth1Error : has no documentation (yet)

type TokenFromOAuth1Result

type TokenFromOAuth1Result struct {
	// Oauth2Token : The OAuth 2.0 token generated from the supplied OAuth 1.0
	// token.
	Oauth2Token string `json:"oauth2_token"`
}

TokenFromOAuth1Result : has no documentation (yet)

func NewTokenFromOAuth1Result

func NewTokenFromOAuth1Result(Oauth2Token string) *TokenFromOAuth1Result

NewTokenFromOAuth1Result returns a new TokenFromOAuth1Result instance

type TokenFromOauth1APIError

type TokenFromOauth1APIError struct {
	dropbox.APIError
	EndpointError *TokenFromOAuth1Error `json:"error"`
}

TokenFromOauth1APIError is an error-wrapper for the token/from_oauth1 route

type TokenRevokeAPIError

type TokenRevokeAPIError struct {
	dropbox.APIError
	EndpointError struct{} `json:"error"`
}

TokenRevokeAPIError is an error-wrapper for the token/revoke route

type TokenScopeError

type TokenScopeError struct {
	// RequiredScope : The required scope to access the route.
	RequiredScope string `json:"required_scope"`
}

TokenScopeError : has no documentation (yet)

func NewTokenScopeError

func NewTokenScopeError(RequiredScope string) *TokenScopeError

NewTokenScopeError returns a new TokenScopeError instance

Jump to

Keyboard shortcuts

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