You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user_app.go 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. package structs
  5. import (
  6. "time"
  7. )
  8. // AccessToken represents an API access token.
  9. // swagger:response AccessToken
  10. type AccessToken struct {
  11. ID int64 `json:"id"`
  12. Name string `json:"name"`
  13. Token string `json:"sha1"`
  14. TokenLastEight string `json:"token_last_eight"`
  15. Scopes []string `json:"scopes"`
  16. }
  17. // AccessTokenList represents a list of API access token.
  18. // swagger:response AccessTokenList
  19. type AccessTokenList []*AccessToken
  20. // CreateAccessTokenOption options when create access token
  21. type CreateAccessTokenOption struct {
  22. // required: true
  23. Name string `json:"name" binding:"Required"`
  24. Scopes []string `json:"scopes"`
  25. }
  26. // CreateOAuth2ApplicationOptions holds options to create an oauth2 application
  27. type CreateOAuth2ApplicationOptions struct {
  28. Name string `json:"name" binding:"Required"`
  29. ConfidentialClient bool `json:"confidential_client"`
  30. RedirectURIs []string `json:"redirect_uris" binding:"Required"`
  31. }
  32. // OAuth2Application represents an OAuth2 application.
  33. // swagger:response OAuth2Application
  34. type OAuth2Application struct {
  35. ID int64 `json:"id"`
  36. Name string `json:"name"`
  37. ClientID string `json:"client_id"`
  38. ClientSecret string `json:"client_secret"`
  39. ConfidentialClient bool `json:"confidential_client"`
  40. RedirectURIs []string `json:"redirect_uris"`
  41. Created time.Time `json:"created"`
  42. }
  43. // OAuth2ApplicationList represents a list of OAuth2 applications.
  44. // swagger:response OAuth2ApplicationList
  45. type OAuth2ApplicationList []*OAuth2Application