MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / AdminLogin

Method AdminLogin

internal/grpcsrv/handlers/admin.go:29–38  ·  view source on GitHub ↗

AdminLogin delegates to service.AdminLogin and lifts the admin session cookie side-effect onto the outgoing stream (grpc-gateway promotes it to Set-Cookie for REST callers). Public entry point — does not require an existing session.

(ctx context.Context, req *authorizerv1.AdminLoginRequest)

Source from the content-addressed store, hash-verified

27// side-effect onto the outgoing stream (grpc-gateway promotes it to Set-Cookie
28// for REST callers). Public entry point — does not require an existing session.
29func (h *AdminHandler) AdminLogin(ctx context.Context, req *authorizerv1.AdminLoginRequest) (*authorizerv1.AdminLoginResponse, error) {
30 res, side, err := h.Service.AdminLogin(ctx, transport.MetaFromGRPC(ctx), &model.AdminLoginRequest{
31 AdminSecret: req.AdminSecret,
32 })
33 if err != nil {
34 return nil, err
35 }
36 _ = transport.ApplyToGRPC(ctx, side)
37 return &authorizerv1.AdminLoginResponse{Message: res.Message}, nil
38}
39
40// AdminLogout delegates to service.AdminLogout and applies the cookie-clearing
41// side-effect. Requires super-admin auth.

Callers

nothing calls this directly

Calls 3

MetaFromGRPCFunction · 0.92
ApplyToGRPCFunction · 0.92
AdminLoginMethod · 0.65

Tested by

no test coverage detected