All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 1m5s
69 lines
1.7 KiB
Plaintext
69 lines
1.7 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "Authenticator API"
|
|
desc: "Authenticator API"
|
|
author: "cialloo"
|
|
date: "2025-10-07"
|
|
version: "v1"
|
|
)
|
|
|
|
type (
|
|
PingReq {}
|
|
PingResp {
|
|
ok bool `json:"ok"`
|
|
}
|
|
)
|
|
|
|
type (
|
|
SteamLoginInitReq {}
|
|
// No response needed - endpoint will redirect directly
|
|
)
|
|
|
|
type (
|
|
SteamLoginCallbackReq {
|
|
OpenidMode string `form:"openid.mode"`
|
|
OpenidNs string `form:"openid.ns"`
|
|
OpenidOpEndpoint string `form:"openid.op_endpoint"`
|
|
OpenidClaimedId string `form:"openid.claimed_id"`
|
|
OpenidIdentity string `form:"openid.identity"`
|
|
OpenidReturnTo string `form:"openid.return_to"`
|
|
OpenidResponseNonce string `form:"openid.response_nonce"`
|
|
OpenidAssocHandle string `form:"openid.assoc_handle"`
|
|
OpenidSigned string `form:"openid.signed"`
|
|
OpenidSig string `form:"openid.sig"`
|
|
}
|
|
SteamLoginCallbackResp {
|
|
Success bool `json:"success"`
|
|
SteamId string `json:"steamId,omitempty"`
|
|
Message string `json:"message,omitempty"`
|
|
}
|
|
)
|
|
|
|
@server (
|
|
prefix: /api/authenticator
|
|
)
|
|
service Authenticator {
|
|
@doc (
|
|
summary: "Ping the server to check if it's alive"
|
|
description: "Ping the server to check if it's alive"
|
|
)
|
|
@handler pingHandler
|
|
get /ping (PingReq) returns (PingResp)
|
|
|
|
@doc (
|
|
summary: "Initiate Steam login"
|
|
description: "Redirects user to Steam OpenID login page with nonce for security"
|
|
)
|
|
@handler steamLoginInitHandler
|
|
get /steam/login (SteamLoginInitReq)
|
|
|
|
@doc (
|
|
summary: "Steam login callback"
|
|
description: "Handles the callback from Steam after user authentication"
|
|
)
|
|
@handler steamLoginCallbackHandler
|
|
get /steam/callback (SteamLoginCallbackReq) returns (SteamLoginCallbackResp)
|
|
}
|
|
|