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.

142 lines
3.3 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(
  17. isEnabled: Boolean
  18. ): [AuthenticationStrategy]
  19. }
  20. # -----------------------------------------------
  21. # MUTATIONS
  22. # -----------------------------------------------
  23. type AuthenticationMutation {
  24. createApiKey(
  25. name: String!
  26. expiration: String!
  27. fullAccess: Boolean!
  28. group: Int
  29. ): AuthenticationCreateApiKeyResponse @auth(requires: ["manage:system", "manage:api"])
  30. login(
  31. username: String!
  32. password: String!
  33. strategy: String!
  34. ): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
  35. loginTFA(
  36. continuationToken: String!
  37. securityCode: String!
  38. ): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
  39. loginChangePassword(
  40. continuationToken: String!
  41. newPassword: String!
  42. ): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
  43. register(
  44. email: String!
  45. password: String!
  46. name: String!
  47. ): AuthenticationRegisterResponse
  48. revokeApiKey(
  49. id: Int!
  50. ): DefaultResponse @auth(requires: ["manage:system", "manage:api"])
  51. setApiState(
  52. enabled: Boolean!
  53. ): DefaultResponse @auth(requires: ["manage:system", "manage:api"])
  54. updateStrategies(
  55. strategies: [AuthenticationStrategyInput]!
  56. config: AuthenticationConfigInput
  57. ): DefaultResponse @auth(requires: ["manage:system"])
  58. regenerateCertificates: DefaultResponse @auth(requires: ["manage:system"])
  59. resetGuestUser: DefaultResponse @auth(requires: ["manage:system"])
  60. }
  61. # -----------------------------------------------
  62. # TYPES
  63. # -----------------------------------------------
  64. type AuthenticationStrategy {
  65. isEnabled: Boolean!
  66. key: String!
  67. props: [String]
  68. title: String!
  69. description: String
  70. isAvailable: Boolean
  71. useForm: Boolean!
  72. logo: String
  73. color: String
  74. website: String
  75. icon: String
  76. config: [KeyValuePair] @auth(requires: ["manage:system"])
  77. selfRegistration: Boolean!
  78. domainWhitelist: [String]! @auth(requires: ["manage:system"])
  79. autoEnrollGroups: [Int]! @auth(requires: ["manage:system"])
  80. }
  81. type AuthenticationLoginResponse {
  82. responseResult: ResponseStatus
  83. jwt: String
  84. mustChangePwd: Boolean
  85. mustProvideTFA: Boolean
  86. continuationToken: String
  87. }
  88. type AuthenticationRegisterResponse {
  89. responseResult: ResponseStatus
  90. jwt: String
  91. }
  92. input AuthenticationStrategyInput {
  93. isEnabled: Boolean!
  94. key: String!
  95. config: [KeyValuePairInput]
  96. selfRegistration: Boolean!
  97. domainWhitelist: [String]!
  98. autoEnrollGroups: [Int]!
  99. }
  100. input AuthenticationConfigInput {
  101. audience: String!
  102. tokenExpiration: String!
  103. tokenRenewal: String!
  104. }
  105. type AuthenticationApiKey {
  106. id: Int!
  107. name: String!
  108. keyShort: String!
  109. expiration: Date!
  110. createdAt: Date!
  111. updatedAt: Date!
  112. isRevoked: Boolean!
  113. }
  114. type AuthenticationCreateApiKeyResponse {
  115. responseResult: ResponseStatus
  116. key: String
  117. }