Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package structs
  6. import (
  7. "time"
  8. )
  9. // AccessToken represents an API access token.
  10. // swagger:response AccessToken
  11. type AccessToken struct {
  12. ID int64 `json:"id"`
  13. Name string `json:"name"`
  14. Token string `json:"sha1"`
  15. TokenLastEight string `json:"token_last_eight"`
  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. // swagger:parameters userCreateToken
  22. type CreateAccessTokenOption struct {
  23. Name string `json:"name" binding:"Required"`
  24. }
  25. // CreateOAuth2ApplicationOptions holds options to create an oauth2 application
  26. type CreateOAuth2ApplicationOptions struct {
  27. Name string `json:"name" binding:"Required"`
  28. RedirectURIs []string `json:"redirect_uris" binding:"Required"`
  29. }
  30. // OAuth2Application represents an OAuth2 application.
  31. // swagger:response OAuth2Application
  32. type OAuth2Application struct {
  33. ID int64 `json:"id"`
  34. Name string `json:"name"`
  35. ClientID string `json:"client_id"`
  36. ClientSecret string `json:"client_secret"`
  37. RedirectURIs []string `json:"redirect_uris"`
  38. Created time.Time `json:"created"`
  39. }
  40. // OAuth2ApplicationList represents a list of OAuth2 applications.
  41. // swagger:response OAuth2ApplicationList
  42. type OAuth2ApplicationList []*OAuth2Application