Categorygithub.com/jyouturner/gotoauth
modulepackage
0.0.3
Repository: https://github.com/jyouturner/gotoauth.git
Documentation: pkg.go.dev

# README

npm install -g serverless
serverless plugin install -n serverless-pseudo-parameters

{
			"user": {
				"org_id": "12345",
				"user_id": "abcde"
			}
}

# Packages

when the app is deployed at AWS, we will use below to save the environment and configurations.
No description provided by the author
No description provided by the author

# Functions

ConfigFromJSON will create the oauth2 config from JSON, with specified scope.
ConfigFromLocalJSONFile loads oauth2 config from local json file.
Exchange gets the oauth2 access token from the auth code and save it, based on the oauth config.
GetAuthUrl returns the oauth2 url to get autocode from the provider.
NewClient will return a http client with the tokens from the token file.
No description provided by the author
No description provided by the author

# Structs

LocalTokenStorage provides the methods to persist the token in local file.
NotifyRefreshTokenSource is essentially `oauth2.ResuseTokenSource` with `TokenNotifyFunc` added.
UserOauthConfig wraps the oatuh secret (for example the oauth2 config JSON) and the token storage specfic to the user.

# Interfaces

OAuthConfigProvider defines the functions that the config provider (for example AWS, Local or database) implement to provide the needed configuration data.
No description provided by the author
No description provided by the author
OauthState defines the functions to manage the data saved with the auth state(nounce), it is expected to have the provide data and user data in it.
TokenStorage defines the interface for the token storages for example AWS S3, AWS Secret Manager or K8S secret.

# Type aliases

TokenNotifyFunc is a function that accepts an oauth2 Token upon refresh, and returns an error if it should not be used.