func New()

in internal/auth/auth.go [747:775]


func New(options *Options) (*Auth, error) {
	// generate 3 keys, 2 for the cookie store and 1 for JWT signing
	keys, err := generateKeys(options.StoreSecret, 3)
	if err != nil {
		return nil, err
	}
	httpTransport := httptransport.NewTransportWithClientCert(options.ClientCfg)

	return &Auth{
		pagesDomain:          options.PagesDomain,
		clientID:             options.ClientID,
		clientSecret:         options.ClientSecret,
		redirectURI:          options.RedirectURI,
		internalGitlabServer: strings.TrimRight(options.InternalGitlabServer, "/"),
		publicGitlabServer:   strings.TrimRight(options.PublicGitlabServer, "/"),
		apiClient: &http.Client{
			Timeout:   options.AuthTimeout,
			Transport: httpTransport,
		},
		store:                sessions.NewCookieStore(keys[0], keys[1]),
		authSecret:           options.StoreSecret,
		authScope:            options.AuthScope,
		jwtSigningKey:        keys[2],
		jwtExpiry:            time.Minute,
		now:                  time.Now,
		cookieSessionTimeout: options.CookieSessionTimeout,
		allowNamespaceInPath: options.AllowNamespaceInPath,
	}, nil
}