Documentation
¶
Overview ¶
Package oauth implements HubSpot's provider-owned OAuth2 protocol boundary.
Index ¶
- Variables
- type AuthorizationURLParams
- type Client
- func (c *Client) AuthorizationURL(params AuthorizationURLParams) (string, error)
- func (c *Client) ExchangeCode(ctx context.Context, code string) (TokenSet, error)
- func (c *Client) Refresh(ctx context.Context, refreshToken string) (TokenSet, error)
- func (c *Client) Revoke(ctx context.Context, refreshToken string) error
- func (*Client) ScopePlan() ScopePlan
- type Config
- type ScopePlan
- type TokenSet
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidGrant identifies rejected authorization codes and refresh tokens. ErrInvalidGrant = xerror.New(xerror.KindInvalidInput, "HUBSPOT_INVALID_GRANT", "HubSpot OAuth invalid grant") )
Functions ¶
This section is empty.
Types ¶
type AuthorizationURLParams ¶
AuthorizationURLParams contains the state and scopes for a consent request.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client performs HubSpot consent, token, refresh, and revocation requests.
func (*Client) AuthorizationURL ¶
func (c *Client) AuthorizationURL(params AuthorizationURLParams) (string, error)
AuthorizationURL builds the HubSpot consent URL for the supplied state and scopes.
func (*Client) ExchangeCode ¶
ExchangeCode exchanges a one-time authorization code for a normalized token set.
func (*Client) Refresh ¶
Refresh exchanges a refresh token while preserving HubSpot's granted scopes.
type Config ¶
type Config struct {
AllowPlaintext bool
ClientID string
ClientSecret string
RedirectURI string
BaseURL string
}
Config contains deployment-owned HubSpot OAuth client settings.
Click to show internal directories.
Click to hide internal directories.