authentication.graphql 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # ===============================================
  2. # AUTHENTICATION
  3. # ===============================================
  4. extend type Query {
  5. apiKeys: [AuthenticationApiKey]
  6. apiState: Boolean
  7. authStrategies: [AuthenticationStrategy]
  8. authActiveStrategies: [AuthenticationActiveStrategy]
  9. authSiteStrategies(
  10. siteId: UUID!
  11. visibleOnly: Boolean
  12. ): [AuthenticationSiteStrategy]
  13. }
  14. extend type Mutation {
  15. createApiKey(
  16. name: String!
  17. expiration: String!
  18. groups: [UUID]!
  19. ): AuthenticationCreateApiKeyResponse
  20. login(
  21. username: String!
  22. password: String!
  23. strategy: String!
  24. ): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
  25. loginTFA(
  26. continuationToken: String!
  27. securityCode: String!
  28. setup: Boolean
  29. ): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
  30. loginChangePassword(
  31. continuationToken: String!
  32. newPassword: String!
  33. ): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
  34. forgotPassword(
  35. email: String!
  36. ): DefaultResponse @rateLimit(limit: 3, duration: 60)
  37. register(
  38. email: String!
  39. password: String!
  40. name: String!
  41. ): AuthenticationRegisterResponse
  42. revokeApiKey(
  43. id: UUID!
  44. ): DefaultResponse
  45. setApiState(
  46. enabled: Boolean!
  47. ): DefaultResponse
  48. updateAuthStrategies(
  49. strategies: [AuthenticationStrategyInput]!
  50. ): DefaultResponse
  51. regenerateCertificates: DefaultResponse
  52. resetGuestUser: DefaultResponse
  53. }
  54. # -----------------------------------------------
  55. # TYPES
  56. # -----------------------------------------------
  57. type AuthenticationStrategy {
  58. key: String
  59. props: JSON
  60. title: String
  61. description: String
  62. isAvailable: Boolean
  63. useForm: Boolean
  64. usernameType: String
  65. logo: String
  66. color: String
  67. vendor: String
  68. website: String
  69. icon: String
  70. }
  71. type AuthenticationActiveStrategy {
  72. id: UUID
  73. strategy: AuthenticationStrategy
  74. displayName: String
  75. isEnabled: Boolean
  76. config: JSON
  77. selfRegistration: Boolean
  78. domainWhitelist: [String]
  79. autoEnrollGroups: [Int]
  80. }
  81. type AuthenticationSiteStrategy {
  82. id: UUID
  83. activeStrategy: AuthenticationActiveStrategy
  84. order: Int
  85. isVisible: Boolean
  86. }
  87. type AuthenticationLoginResponse {
  88. operation: Operation
  89. jwt: String
  90. mustChangePwd: Boolean
  91. mustProvideTFA: Boolean
  92. mustSetupTFA: Boolean
  93. continuationToken: String
  94. redirect: String
  95. tfaQRImage: String
  96. }
  97. type AuthenticationRegisterResponse {
  98. operation: Operation
  99. jwt: String
  100. }
  101. input AuthenticationStrategyInput {
  102. key: String!
  103. strategyKey: String!
  104. config: [KeyValuePairInput]
  105. displayName: String!
  106. order: Int!
  107. isEnabled: Boolean!
  108. selfRegistration: Boolean!
  109. domainWhitelist: [String]!
  110. autoEnrollGroups: [Int]!
  111. }
  112. type AuthenticationApiKey {
  113. id: UUID
  114. name: String
  115. keyShort: String
  116. expiration: Date
  117. createdAt: Date
  118. updatedAt: Date
  119. isRevoked: Boolean
  120. }
  121. type AuthenticationCreateApiKeyResponse {
  122. operation: Operation
  123. key: String
  124. }