Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API endpoints to manage OAuth2 Application (list/create/delete) #10437

Merged
merged 15 commits into from
Feb 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add Created time to API response
  • Loading branch information
Gustavo Marin committed Feb 25, 2020
commit c42988df1635fdbcb093d2d09bc972ac74e21909
1 change: 1 addition & 0 deletions modules/convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,6 @@ func ToOAuth2Application(app *models.OAuth2Application) *api.OAuth2Application {
ClientID: app.ClientID,
ClientSecret: app.ClientSecret,
RedirectURIs: app.RedirectURIs,
Created: app.CreatedUnix.AsTime(),
}
}
12 changes: 7 additions & 5 deletions modules/structs/user_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package structs

import (
"encoding/base64"
"time"
)

// BasicAuthEncode generate base64 of basic auth head
Expand Down Expand Up @@ -42,11 +43,12 @@ type CreateOAuth2ApplicationOptions struct {
// OAuth2Application represents an OAuth2 application.
// swagger:response OAuth2Application
type OAuth2Application struct {
ID int64 `json:"id"`
Name string `json:"name"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
RedirectURIs []string `json:"redirect_uris"`
ID int64 `json:"id"`
Name string `json:"name"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
RedirectURIs []string `json:"redirect_uris"`
Created time.Time `json:"created"`
}

// OAuth2ApplicationList represents a list of OAuth2 applications.
Expand Down
5 changes: 5 additions & 0 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12299,6 +12299,11 @@
"type": "string",
"x-go-name": "ClientSecret"
},
"created": {
"type": "string",
"format": "date-time",
"x-go-name": "Created"
},
"id": {
"type": "integer",
"format": "int64",
Expand Down