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.

156 lines
3.6 KiB

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