Skip to content

Commit 9bf00d5

Browse files
Brownjyhunjixin
authored andcommitted
fix: fix authentication mechanism
1 parent db09e8b commit 9bf00d5

File tree

4 files changed

+49
-28
lines changed

4 files changed

+49
-28
lines changed

api/api_impl/server.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package apiimpl
33
import (
44
"context"
55
"errors"
6+
"github.com/jiaozifs/jiaozifs/auth"
67
"net"
78
"net/http"
89

@@ -17,8 +18,6 @@ import (
1718

1819
"github.com/jiaozifs/jiaozifs/models"
1920

20-
"github.com/jiaozifs/jiaozifs/auth"
21-
2221
"net/url"
2322

2423
"github.com/getkin/kin-openapi/openapi3filter"

api/jiaozifs.gen.go

Lines changed: 12 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/resp.gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,42 @@ servers:
1414
- url: "/api/v1"
1515
description: jiaozifs server endpoint
1616
security:
17-
- jwt_token: []
17+
- jwt_token: [] # Default security for the entire API
1818
- basic_auth: []
1919
- cookie_auth: []
2020
components:
21+
parameters:
22+
PaginationPrefix:
23+
in: query
24+
name: prefix
25+
description: return items prefixed with this value
26+
schema:
27+
type: string
28+
29+
PaginationAfter:
30+
in: query
31+
name: after
32+
description: return items after this value
33+
schema:
34+
type: string
35+
36+
PaginationAmount:
37+
in: query
38+
name: amount
39+
description: how many items to return
40+
schema:
41+
type: integer
42+
minimum: -1
43+
maximum: 1000
44+
default: 100
45+
46+
PaginationDelimiter:
47+
in: query
48+
name: delimiter
49+
description: delimiter used to group common prefixes by
50+
schema:
51+
type: string
52+
2153
securitySchemes:
2254
basic_auth:
2355
type: http
@@ -488,6 +520,7 @@ paths:
488520
- common
489521
operationId: getVersion
490522
summary: return program and runtime version
523+
security: [] # No authentication
491524
responses:
492525
200:
493526
description: program version
@@ -1344,6 +1377,7 @@ paths:
13441377
- auth
13451378
operationId: register
13461379
summary: perform user registration
1380+
security: [] # No authentication
13471381
requestBody:
13481382
content:
13491383
application/json:

0 commit comments

Comments
 (0)