authentication.graphql 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # ===============================================
  2. # AUTHENTICATION
  3. # ===============================================
  4. extend type Query {
  5. apiKeys: [AuthenticationApiKey]
  6. apiState: Boolean
  7. authStrategies: [AuthenticationStrategy]
  8. authSiteStrategies(
  9. siteId: UUID!
  10. enabledOnly: Boolean
  11. ): [AuthenticationSiteStrategy]
  12. }
  13. extend type Mutation {
  14. createApiKey(
  15. name: String!
  16. expiration: String!
  17. fullAccess: Boolean!
  18. group: Int
  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: Int!
  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: [KeyValuePair]
  60. title: String
  61. description: String
  62. isAvailable: Boolean
  63. useForm: Boolean
  64. usernameType: String
  65. logo: String
  66. color: String
  67. website: String
  68. icon: String
  69. }
  70. type AuthenticationSiteStrategy {
  71. key: String
  72. strategy: AuthenticationStrategy
  73. displayName: String
  74. order: Int
  75. isEnabled: Boolean
  76. config: [KeyValuePair]
  77. selfRegistration: Boolean
  78. domainWhitelist: [String]
  79. autoEnrollGroups: [Int]
  80. }
  81. type AuthenticationLoginResponse {
  82. operation: Operation
  83. jwt: String
  84. mustChangePwd: Boolean
  85. mustProvideTFA: Boolean
  86. mustSetupTFA: Boolean
  87. continuationToken: String
  88. redirect: String
  89. tfaQRImage: String
  90. }
  91. type AuthenticationRegisterResponse {
  92. operation: Operation
  93. jwt: String
  94. }
  95. input AuthenticationStrategyInput {
  96. key: String!
  97. strategyKey: String!
  98. config: [KeyValuePairInput]
  99. displayName: String!
  100. order: Int!
  101. isEnabled: Boolean!
  102. selfRegistration: Boolean!
  103. domainWhitelist: [String]!
  104. autoEnrollGroups: [Int]!
  105. }
  106. type AuthenticationApiKey {
  107. id: Int!
  108. name: String!
  109. keyShort: String!
  110. expiration: Date!
  111. createdAt: Date!
  112. updatedAt: Date!
  113. isRevoked: Boolean!
  114. }
  115. type AuthenticationCreateApiKeyResponse {
  116. operation: Operation
  117. key: String
  118. }