steam 2fa for polling and security
All checks were successful
Release and Deploy / build (push) Successful in 6m8s
Release and Deploy / deploy (push) Successful in 27s

This commit is contained in:
Fran Jurmanović
2025-08-16 16:43:54 +02:00
parent 1683d5c2f1
commit aab5d2ad61
32 changed files with 2191 additions and 98 deletions

View File

@@ -218,6 +218,52 @@ const docTemplate = `{
}
}
},
"/auth/open-token": {
"post": {
"description": "Generate an open token for a user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authentication"
],
"summary": "Generate an open token",
"responses": {
"200": {
"description": "JWT token",
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Invalid credentials",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/lookup/car-models": {
"get": {
"security": [
@@ -1777,6 +1823,182 @@ const docTemplate = `{
}
}
},
"/steam2fa/pending": {
"get": {
"description": "Get all pending Steam 2FA authentication requests",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Steam 2FA"
],
"summary": "Get pending 2FA requests",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Steam2FARequest"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/steam2fa/{id}": {
"get": {
"description": "Get a specific Steam 2FA authentication request by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Steam 2FA"
],
"summary": "Get 2FA request",
"parameters": [
{
"type": "string",
"description": "2FA Request ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Steam2FARequest"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/steam2fa/{id}/cancel": {
"post": {
"description": "Cancel a Steam 2FA authentication request",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Steam 2FA"
],
"summary": "Cancel 2FA request",
"parameters": [
{
"type": "string",
"description": "2FA Request ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Steam2FARequest"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/steam2fa/{id}/complete": {
"post": {
"description": "Mark a Steam 2FA authentication request as completed",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Steam 2FA"
],
"summary": "Complete 2FA request",
"parameters": [
{
"type": "string",
"description": "2FA Request ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Steam2FARequest"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/system/health": {
"get": {
"description": "Return service control status",
@@ -1934,6 +2156,47 @@ const docTemplate = `{
"StatusRunning"
]
},
"model.Steam2FARequest": {
"type": "object",
"properties": {
"completedAt": {
"type": "string"
},
"errorMsg": {
"type": "string"
},
"id": {
"type": "string"
},
"message": {
"type": "string"
},
"requestTime": {
"type": "string"
},
"serverId": {
"type": "string"
},
"status": {
"$ref": "#/definitions/model.Steam2FAStatus"
}
}
},
"model.Steam2FAStatus": {
"type": "string",
"enum": [
"idle",
"pending",
"complete",
"error"
],
"x-enum-varnames": [
"Steam2FAStatusIdle",
"Steam2FAStatusPending",
"Steam2FAStatusComplete",
"Steam2FAStatusError"
]
},
"model.User": {
"type": "object",
"properties": {

View File

@@ -215,6 +215,52 @@
}
}
},
"/auth/open-token": {
"post": {
"description": "Generate an open token for a user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authentication"
],
"summary": "Generate an open token",
"responses": {
"200": {
"description": "JWT token",
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Invalid credentials",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/lookup/car-models": {
"get": {
"security": [
@@ -1774,6 +1820,182 @@
}
}
},
"/steam2fa/pending": {
"get": {
"description": "Get all pending Steam 2FA authentication requests",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Steam 2FA"
],
"summary": "Get pending 2FA requests",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Steam2FARequest"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/steam2fa/{id}": {
"get": {
"description": "Get a specific Steam 2FA authentication request by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Steam 2FA"
],
"summary": "Get 2FA request",
"parameters": [
{
"type": "string",
"description": "2FA Request ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Steam2FARequest"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/steam2fa/{id}/cancel": {
"post": {
"description": "Cancel a Steam 2FA authentication request",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Steam 2FA"
],
"summary": "Cancel 2FA request",
"parameters": [
{
"type": "string",
"description": "2FA Request ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Steam2FARequest"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/steam2fa/{id}/complete": {
"post": {
"description": "Mark a Steam 2FA authentication request as completed",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Steam 2FA"
],
"summary": "Complete 2FA request",
"parameters": [
{
"type": "string",
"description": "2FA Request ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Steam2FARequest"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/system/health": {
"get": {
"description": "Return service control status",
@@ -1931,6 +2153,47 @@
"StatusRunning"
]
},
"model.Steam2FARequest": {
"type": "object",
"properties": {
"completedAt": {
"type": "string"
},
"errorMsg": {
"type": "string"
},
"id": {
"type": "string"
},
"message": {
"type": "string"
},
"requestTime": {
"type": "string"
},
"serverId": {
"type": "string"
},
"status": {
"$ref": "#/definitions/model.Steam2FAStatus"
}
}
},
"model.Steam2FAStatus": {
"type": "string",
"enum": [
"idle",
"pending",
"complete",
"error"
],
"x-enum-varnames": [
"Steam2FAStatusIdle",
"Steam2FAStatusPending",
"Steam2FAStatusComplete",
"Steam2FAStatusError"
]
},
"model.User": {
"type": "object",
"properties": {

View File

@@ -92,6 +92,35 @@ definitions:
- StatusRestarting
- StatusStarting
- StatusRunning
model.Steam2FARequest:
properties:
completedAt:
type: string
errorMsg:
type: string
id:
type: string
message:
type: string
requestTime:
type: string
serverId:
type: string
status:
$ref: '#/definitions/model.Steam2FAStatus'
type: object
model.Steam2FAStatus:
enum:
- idle
- pending
- complete
- error
type: string
x-enum-varnames:
- Steam2FAStatusIdle
- Steam2FAStatusPending
- Steam2FAStatusComplete
- Steam2FAStatusError
model.User:
properties:
id:
@@ -247,6 +276,36 @@ paths:
summary: Get current user details
tags:
- Authentication
/auth/open-token:
post:
consumes:
- application/json
description: Generate an open token for a user
produces:
- application/json
responses:
"200":
description: JWT token
schema:
properties:
token:
type: string
type: object
"400":
description: Invalid request body
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
"401":
description: Invalid credentials
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
"500":
description: Internal server error
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
summary: Generate an open token
tags:
- Authentication
/lookup/car-models:
get:
consumes:
@@ -1242,6 +1301,122 @@ paths:
summary: Return StateHistorys
tags:
- StateHistory
/steam2fa/{id}:
get:
consumes:
- application/json
description: Get a specific Steam 2FA authentication request by ID
parameters:
- description: 2FA Request ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/model.Steam2FARequest'
"404":
description: Not Found
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
summary: Get 2FA request
tags:
- Steam 2FA
/steam2fa/{id}/cancel:
post:
consumes:
- application/json
description: Cancel a Steam 2FA authentication request
parameters:
- description: 2FA Request ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/model.Steam2FARequest'
"400":
description: Bad Request
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
summary: Cancel 2FA request
tags:
- Steam 2FA
/steam2fa/{id}/complete:
post:
consumes:
- application/json
description: Mark a Steam 2FA authentication request as completed
parameters:
- description: 2FA Request ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/model.Steam2FARequest'
"400":
description: Bad Request
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
summary: Complete 2FA request
tags:
- Steam 2FA
/steam2fa/pending:
get:
consumes:
- application/json
description: Get all pending Steam 2FA authentication requests
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/model.Steam2FARequest'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/error_handler.ErrorResponse'
summary: Get pending 2FA requests
tags:
- Steam 2FA
/system/health:
get:
description: Return service control status