aha

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 14 Imported by: 5

Documentation

Index

Constants

View Source
const (
	APIMeURL         = "https://secure.aha.io/api/v1/me" // no longer supported by Aha. Must use sub-domain
	BaseURLFormat    = "https://%s.aha.io/"
	APIMeURLFormat   = "https://%s.aha.io/api/v1/me"
	APIMeURLPath     = "/api/v1/me"
	AuthURLFormat    = "https://%s.aha.io/oauth/authorize"
	TokenURLFormat   = "https://%s.aha.io/oauth/token" // #nosec G101
	AhaAccountHeader = "X-AHA-ACCOUNT"
)

Variables

View Source
var (
	AhaAccountEnv = "AHA_ACCOUNT"
	AhaServerURL  = "AHA_SERVER_URL"
	AhaAPIKeyEnv  = "AHA_API_KEY" // #nosec G101
)

Functions

func BuildCredentials added in v0.21.0

func BuildCredentials(subdomainOrBaseURL, token string) goauth.Credentials

func NewClient

func NewClient(subdomain, token string) (*http.Client, error)

func NewEndpoint

func NewEndpoint(subdomain string) oauth2.Endpoint

func NewSimpleClient added in v0.21.0

func NewSimpleClient(subdomain, token string) (*httpsimple.Client, error)

Types

type AhaUserinfo

type AhaUserinfo struct {
	ID    string `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
}

type AhaUserinfoWrap

type AhaUserinfoWrap struct {
	User *AhaUserinfo `json:"user,omitempty"`
}

type ClientUtil

type ClientUtil struct {
	Client       *http.Client
	SimpleClient *httpsimple.Client
	User         *AhaUserinfo `json:"user,omitempty"`
}

ClientUtil is a client library to retrieve user info from the Facebook API.

func NewClientUtil

func NewClientUtil(client *http.Client) ClientUtil

func (*ClientUtil) GetSCIMUser

func (apiutil *ClientUtil) GetSCIMUser() (scim.User, error)

func (*ClientUtil) GetUserinfo

func (apiutil *ClientUtil) GetUserinfo() (*AhaUserinfo, error)

GetUserinfo retrieves the userinfo from the https://graph.facebook.com/v2.9/{user-id} endpoint.

func (*ClientUtil) SetClient

func (apiutil *ClientUtil) SetClient(client *http.Client)

func (*ClientUtil) SetSimpleClient added in v0.21.0

func (apiutil *ClientUtil) SetSimpleClient(sclient *httpsimple.Client)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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