github.com/quickfeed/quickfeed@v0.0.0-20240507093252-ed8ca812a09c/web/auth/consts.go (about)

     1  package auth
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  type contextKey int
     8  
     9  const (
    10  	contextNone contextKey = iota
    11  	ContextKeyClaims
    12  )
    13  
    14  const (
    15  	Cookie               = "cookie"
    16  	CookieName           = "auth"
    17  	SetCookie            = "Set-Cookie"
    18  	tokenExpirationTime  = 15 * time.Minute
    19  	cookieExpirationTime = 24 * time.Hour * 14 // 2 weeks
    20  	alg                  = "HS256"
    21  
    22  	githubUserAPI = "https://api.github.com/user"
    23  
    24  	// Routes
    25  	Auth     = "/auth/"
    26  	Teacher  = "/auth/teacher/"
    27  	Callback = "/auth/callback/"
    28  	Logout   = "/logout"
    29  	Hook     = "/hook/"
    30  	Assets   = "/assets/"
    31  	Static   = "/static/"
    32  )