openapi: try session_id

This commit is contained in:
Quaternions 2024-12-09 19:32:47 -08:00
parent fb6b0ad7c7
commit e495a8423f
2 changed files with 3 additions and 3 deletions

View File

@ -557,7 +557,7 @@ components:
cookieAuth: cookieAuth:
type: apiKey type: apiKey
in: cookie in: cookie
name: SESSIONID name: session_id
schemas: schemas:
Id: Id:
required: required:

View File

@ -35,7 +35,7 @@ func findAuthorization(h http.Header, prefix string) (string, bool) {
func (s *Server) securityCookieAuth(ctx context.Context, operationName OperationName, req *http.Request) (context.Context, bool, error) { func (s *Server) securityCookieAuth(ctx context.Context, operationName OperationName, req *http.Request) (context.Context, bool, error) {
var t CookieAuth var t CookieAuth
const parameterName = "SESSIONID" const parameterName = "session_id"
var value string var value string
switch cookie, err := req.Cookie(parameterName); { switch cookie, err := req.Cookie(parameterName); {
case err == nil: // if NO error case err == nil: // if NO error
@ -67,7 +67,7 @@ func (s *Client) securityCookieAuth(ctx context.Context, operationName Operation
return errors.Wrap(err, "security source \"CookieAuth\"") return errors.Wrap(err, "security source \"CookieAuth\"")
} }
req.AddCookie(&http.Cookie{ req.AddCookie(&http.Cookie{
Name: "SESSIONID", Name: "session_id",
Value: t.APIKey, Value: t.APIKey,
}) })
return nil return nil