Skip to content

Commit 13b7591

Browse files
committed
Add Swagger model annotations and new API routes for OAuth2 authentication management
1 parent b58f94a commit 13b7591

File tree

5 files changed

+207
-3
lines changed

5 files changed

+207
-3
lines changed

modules/structs/auth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
package structs
55

6+
// swagger:model
67
type AuthSourceOption struct {
78
ID int64 `json:"id"`
89
AuthenticationName string `json:"authentication_name" binding:"Required"`

modules/structs/auth_oauth2.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package structs
55

66
// CreateUserOption create user options
7+
// swagger:model
78
type CreateAuthOauth2Option struct {
89
AuthenticationName string `json:"authentication_name" binding:"Required"`
910
ProviderIconURL string `json:"provider_icon_url"`
@@ -27,6 +28,7 @@ type CreateAuthOauth2Option struct {
2728
}
2829

2930
// EditUserOption edit user options
31+
// swagger:model
3032
type EditAuthOauth2Option struct {
3133
AuthenticationName string `json:"authentication_name" binding:"Required"`
3234
ProviderIconURL string `json:"provider_icon_url"`

routers/api/v1/admin/auth_oauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func EditOauthAuth(ctx *context.APIContext) {
136136
return
137137
}
138138

139-
form := web.GetForm(ctx).(*api.CreateAuthOauth2Option)
139+
form := web.GetForm(ctx).(*api.EditAuthOauth2Option)
140140

141141
config := &oauth2.Source{
142142
Provider: "openidConnect",

services/auth/source/oauth2/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Source struct {
2525
GroupTeamMap string
2626
GroupTeamMapRemoval bool
2727
RestrictedGroup string
28-
SkipLocalTwoFA bool `json:",omitempty"`
28+
SkipLocalTwoFA bool
2929

3030
// reference to the authSource
3131
authSource *auth.Source

templates/swagger/v1_json.tmpl

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

0 commit comments

Comments
 (0)