Upgrade golang to 1.25.1 and add descriptions for the swagger structs' fields (#35418)

This commit is contained in:
Lunny Xiao
2025-09-06 09:52:41 -07:00
committed by GitHub
parent b8f1c9f048
commit c290682521
51 changed files with 1928 additions and 656 deletions

View File

@@ -11,13 +11,20 @@ import (
// AccessToken represents an API access token.
// swagger:response AccessToken
type AccessToken struct {
ID int64 `json:"id"`
Name string `json:"name"`
Token string `json:"sha1"`
TokenLastEight string `json:"token_last_eight"`
Scopes []string `json:"scopes"`
Created time.Time `json:"created_at"`
Updated time.Time `json:"last_used_at"`
// The unique identifier of the access token
ID int64 `json:"id"`
// The name of the access token
Name string `json:"name"`
// The SHA1 hash of the access token
Token string `json:"sha1"`
// The last eight characters of the token
TokenLastEight string `json:"token_last_eight"`
// The scopes granted to this access token
Scopes []string `json:"scopes"`
// The timestamp when the token was created
Created time.Time `json:"created_at"`
// The timestamp when the token was last used
Updated time.Time `json:"last_used_at"`
}
// AccessTokenList represents a list of API access token.
@@ -35,23 +42,35 @@ type CreateAccessTokenOption struct {
// CreateOAuth2ApplicationOptions holds options to create an oauth2 application
type CreateOAuth2ApplicationOptions struct {
Name string `json:"name" binding:"Required"`
ConfidentialClient bool `json:"confidential_client"`
SkipSecondaryAuthorization bool `json:"skip_secondary_authorization"`
RedirectURIs []string `json:"redirect_uris" binding:"Required"`
// The name of the OAuth2 application
Name string `json:"name" binding:"Required"`
// Whether the client is confidential
ConfidentialClient bool `json:"confidential_client"`
// Whether to skip secondary authorization
SkipSecondaryAuthorization bool `json:"skip_secondary_authorization"`
// The list of allowed redirect URIs
RedirectURIs []string `json:"redirect_uris" binding:"Required"`
}
// 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"`
ConfidentialClient bool `json:"confidential_client"`
SkipSecondaryAuthorization bool `json:"skip_secondary_authorization"`
RedirectURIs []string `json:"redirect_uris"`
Created time.Time `json:"created"`
// The unique identifier of the OAuth2 application
ID int64 `json:"id"`
// The name of the OAuth2 application
Name string `json:"name"`
// The client ID of the OAuth2 application
ClientID string `json:"client_id"`
// The client secret of the OAuth2 application
ClientSecret string `json:"client_secret"`
// Whether the client is confidential
ConfidentialClient bool `json:"confidential_client"`
// Whether to skip secondary authorization
SkipSecondaryAuthorization bool `json:"skip_secondary_authorization"`
// The list of allowed redirect URIs
RedirectURIs []string `json:"redirect_uris"`
// The timestamp when the application was created
Created time.Time `json:"created"`
}
// OAuth2ApplicationList represents a list of OAuth2 applications.