diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-15 17:21:19 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-21 18:28:00 +0100 |
| commit | 35aa646c476c62b11377e25ac0b20e5054e2c5da (patch) | |
| tree | cb9b0b2533319210facd3d5c2cb4727289f09ae2 /internal | |
| parent | 0357b97b15c62147557b49cd50ee690aba93c06d (diff) | |
OAuth: Do not export ExchangeSession
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/oauth/oauth.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/oauth/oauth.go b/internal/oauth/oauth.go index e3bbd6e..ce86337 100644 --- a/internal/oauth/oauth.go +++ b/internal/oauth/oauth.go @@ -85,15 +85,15 @@ type OAuth struct { TokenURL string `json:"token_url"` // session is the internal in progress OAuth session - session ExchangeSession + session exchangeSession // Token is where the access and refresh tokens are stored along with the timestamps // It is protected by a lock token *tokenLock } -// ExchangeSession is a structure that gets passed to the callback for easy access to the current state. -type ExchangeSession struct { +// exchangeSession is a structure that gets passed to the callback for easy access to the current state. +type exchangeSession struct { // ClientID is the ID of the OAuth client ClientID string @@ -328,7 +328,7 @@ func writeResponseHTML(w http.ResponseWriter, title string, message string) erro // Authcode gets the authorization code from the url // It returns the code and an error if there is one -func (s *ExchangeSession) Authcode(url *url.URL) (string, error) { +func (s *exchangeSession) Authcode(url *url.URL) (string, error) { // ISS: https://www.rfc-editor.org/rfc/rfc9207.html // TODO: Make this a required parameter in the future q := url.Query() @@ -424,7 +424,7 @@ func (oauth *OAuth) AuthURL(name string, postProcessAuth func(string) string) (s oauth.token = &tokenLock{t: &token{Refresher: oauth.refreshResponse}} // Fill the struct with the necessary fields filled for the next call to getting the HTTP client - oauth.session = ExchangeSession{ + oauth.session = exchangeSession{ ClientID: name, ISS: oauth.ISS, State: state, |
