Finish Phase 6: Push frontend, WebAuthn frontend, OpenAPI/Swagger
Frontend: - stores/push.ts: fixed VAPID key endpoint, added checkSubscription, proper subscription format - UserSettings.tsx: added [ENABLE PUSH] toggle and [REGISTER PASSKEY] button - LoginForm.tsx: added [SIGN IN WITH PASSKEY] button Backend: - cmd/server/main.go: added Swagger annotations, /docs/* route - docs/: generated swagger.json, swagger.yaml, docs.go - Makefile: added docs target for swag init
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||
package docs
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
|
||||
const docTemplate = `{
|
||||
"schemes": {{ marshal .Schemes }},
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"description": "{{escape .Description}}",
|
||||
"title": "{{.Title}}",
|
||||
"contact": {},
|
||||
"version": "{{.Version}}"
|
||||
},
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {},
|
||||
"securityDefinitions": {
|
||||
"SessionAuth": {
|
||||
"type": "apiKey",
|
||||
"name": "dumpster_session",
|
||||
"in": "cookie"
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = &swag.Spec{
|
||||
Version: "1.0",
|
||||
Host: "localhost:8080",
|
||||
BasePath: "/api/v1",
|
||||
Schemes: []string{"http", "https"},
|
||||
Title: "Dumpster API",
|
||||
Description: "A chaotic, self-hosted Discord-like platform API",
|
||||
InfoInstanceName: "swagger",
|
||||
SwaggerTemplate: docTemplate,
|
||||
}
|
||||
|
||||
func init() {
|
||||
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"schemes": [
|
||||
"http",
|
||||
"https"
|
||||
],
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"description": "A chaotic, self-hosted Discord-like platform API",
|
||||
"title": "Dumpster API",
|
||||
"contact": {},
|
||||
"version": "1.0"
|
||||
},
|
||||
"host": "localhost:8080",
|
||||
"basePath": "/api/v1",
|
||||
"paths": {},
|
||||
"securityDefinitions": {
|
||||
"SessionAuth": {
|
||||
"type": "apiKey",
|
||||
"name": "dumpster_session",
|
||||
"in": "cookie"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
basePath: /api/v1
|
||||
host: localhost:8080
|
||||
info:
|
||||
contact: {}
|
||||
description: A chaotic, self-hosted Discord-like platform API
|
||||
title: Dumpster API
|
||||
version: "1.0"
|
||||
paths: {}
|
||||
schemes:
|
||||
- http
|
||||
- https
|
||||
securityDefinitions:
|
||||
SessionAuth:
|
||||
in: cookie
|
||||
name: dumpster_session
|
||||
type: apiKey
|
||||
swagger: "2.0"
|
||||
Reference in New Issue
Block a user