Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultHost is the default host for autodesk api DefaultHost = "https://developer.api.autodesk.com" // DefaultAuthenticationPath is the default AuthPath for autodesk api DefaultAuthenticationPath = "authentication/v1" HeaderAuthorization = "Authorization" HeaderXUserID = "x-user-id" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthData ¶
type AuthData struct { ClientID string `json:"client_id,omitempty"` ClientSecret string `json:"client_secret,omitempty"` Host string `json:"host,omitempty"` AuthenticationPath string `json:"auth_path"` }
AuthData reflects the data common to 2-legged and 3-legged api calls
func AuthDataForClient ¶
AuthDataForClient will create a new AuthData object with client info
type Bearer ¶
type Bearer struct { TokenType string `json:"token_type"` // Will always be Bearer ExpiresIn int32 `json:"expires_in"` // Access token expiration time (in seconds) AccessToken string `json:"access_token"` // The access token RefreshToken string `json:"refresh_token,omitempty"` // The refresh token used in 3-legged oauth }
Bearer reflects the response when acquiring a 2-legged token or in 3-legged context for exchanging the authorization code for a token + refresh token and when exchanging the refresh token for a new token
type ForgeAuthenticator ¶
type ForgeAuthenticator interface { // Path returns the full url path with the given compentents Path(...string) string // SetAuthHeader should set the appropriate http headers for auth // It should refresh any tokens it may have SetAuthHeader(scope scopes.Scope, header http.Header) error }
ForgeAuthenticator defines an interface that allows abstraction from a 2-legged and a 3-legged context.
This provides useful when an API accepts both 2-legged and 3-legged context tokens
Click to show internal directories.
Click to hide internal directories.