MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / NewUserAuthWithOAuthConfig

Function NewUserAuthWithOAuthConfig

internal/auth/auth.go:142–154  ·  view source on GitHub ↗

NewUserAuthWithOAuthConfig creates a UserAuth with a custom oauth2.Config and userinfo URL. This is intended for testing against fake OAuth servers.

(cfg *config.OAuthConfig, oauthCfg *oauth2.Config, store *identity.Store, production bool, userInfoURL string)

Source from the content-addressed store, hash-verified

140// NewUserAuthWithOAuthConfig creates a UserAuth with a custom oauth2.Config and
141// userinfo URL. This is intended for testing against fake OAuth servers.
142func NewUserAuthWithOAuthConfig(cfg *config.OAuthConfig, oauthCfg *oauth2.Config, store *identity.Store, production bool, userInfoURL string) *UserAuth {
143 baseURL := ""
144 if u, err := url.Parse(cfg.RedirectURL); err == nil && u.Host != "" {
145 baseURL = u.Scheme + "://" + u.Host
146 }
147 return &UserAuth{
148 oauthConfig: oauthCfg,
149 store: store,
150 secure: production,
151 baseURL: baseURL,
152 userInfoURL: userInfoURL,
153 }
154}
155
156func generateNonce() string {
157 b := make([]byte, 16)

Callers 1

Calls

no outgoing calls

Tested by 1