this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

make S256CodeChallenge part of public API (small and might be helpful)

+4 -3
+1 -1
atproto/auth/oauth/oauth.go
··· 311 311 pkceVerifier := fmt.Sprintf("%s%s%s", randomNonce(), randomNonce(), randomNonce()) 312 312 313 313 // generate PKCE code challenge for use in PAR request 314 - codeChallenge := s256CodeChallenge(pkceVerifier) 314 + codeChallenge := S256CodeChallenge(pkceVerifier) 315 315 316 316 slog.Debug("preparing PAR", "client_id", app.Config.ClientID, "callback_url", app.Config.CallbackURL) 317 317 body := PushedAuthRequest{
+1 -1
atproto/auth/oauth/session.go
··· 171 171 sess.lk.RLock() 172 172 defer sess.lk.RUnlock() 173 173 174 - ath := s256CodeChallenge(sess.Data.AccessToken) 174 + ath := S256CodeChallenge(sess.Data.AccessToken) 175 175 claims := dpopClaims{ 176 176 HTTPMethod: method, 177 177 TargetURI: reqURL,
+2 -1
atproto/auth/oauth/util.go
··· 13 13 return base64.RawURLEncoding.EncodeToString(buf) 14 14 } 15 15 16 - func s256CodeChallenge(raw string) string { 16 + // Computes an SHA-256 base64url-encoded challenge string, as used for PKCE. 17 + func S256CodeChallenge(raw string) string { 17 18 b := sha256.Sum256([]byte(raw)) 18 19 return base64.RawURLEncoding.EncodeToString(b[:]) 19 20 }