2018-03-10 05:58:04 +00:00
|
|
|
# ===============================================
|
|
|
|
# AUTHENTICATION
|
|
|
|
# ===============================================
|
|
|
|
|
2018-03-05 20:49:36 +00:00
|
|
|
extend type Query {
|
|
|
|
authentication: AuthenticationQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
authentication: AuthenticationMutation
|
|
|
|
}
|
|
|
|
|
2018-03-10 05:58:04 +00:00
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
2018-03-05 20:49:36 +00:00
|
|
|
type AuthenticationQuery {
|
2020-02-22 22:38:06 +00:00
|
|
|
apiKeys: [AuthenticationApiKey] @auth(requires: ["manage:system", "manage:api"])
|
|
|
|
|
|
|
|
apiState: Boolean! @auth(requires: ["manage:system", "manage:api"])
|
|
|
|
|
2020-07-03 23:36:33 +00:00
|
|
|
strategies: [AuthenticationStrategy] @auth(requires: ["manage:system"])
|
|
|
|
activeStrategies: [AuthenticationActiveStrategy]
|
2018-03-05 20:49:36 +00:00
|
|
|
}
|
|
|
|
|
2018-03-10 05:58:04 +00:00
|
|
|
# -----------------------------------------------
|
|
|
|
# MUTATIONS
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
2018-03-06 01:53:24 +00:00
|
|
|
type AuthenticationMutation {
|
2020-02-22 22:38:06 +00:00
|
|
|
createApiKey(
|
|
|
|
name: String!
|
|
|
|
expiration: String!
|
|
|
|
fullAccess: Boolean!
|
|
|
|
group: Int
|
|
|
|
): AuthenticationCreateApiKeyResponse @auth(requires: ["manage:system", "manage:api"])
|
|
|
|
|
2018-03-10 05:58:04 +00:00
|
|
|
login(
|
|
|
|
username: String!
|
|
|
|
password: String!
|
2018-06-17 15:12:11 +00:00
|
|
|
strategy: String!
|
2019-02-15 21:36:13 +00:00
|
|
|
): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
|
2018-03-10 05:58:04 +00:00
|
|
|
|
|
|
|
loginTFA(
|
2019-08-25 02:19:35 +00:00
|
|
|
continuationToken: String!
|
2018-03-10 05:58:04 +00:00
|
|
|
securityCode: String!
|
2019-08-25 02:19:35 +00:00
|
|
|
): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
|
|
|
|
|
|
|
|
loginChangePassword(
|
|
|
|
continuationToken: String!
|
|
|
|
newPassword: String!
|
|
|
|
): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
|
2018-03-10 05:58:04 +00:00
|
|
|
|
2018-12-17 05:51:52 +00:00
|
|
|
register(
|
|
|
|
email: String!
|
|
|
|
password: String!
|
|
|
|
name: String!
|
|
|
|
): AuthenticationRegisterResponse
|
|
|
|
|
2020-02-22 22:38:06 +00:00
|
|
|
revokeApiKey(
|
|
|
|
id: Int!
|
|
|
|
): DefaultResponse @auth(requires: ["manage:system", "manage:api"])
|
|
|
|
|
|
|
|
setApiState(
|
|
|
|
enabled: Boolean!
|
|
|
|
): DefaultResponse @auth(requires: ["manage:system", "manage:api"])
|
|
|
|
|
2018-06-26 00:55:00 +00:00
|
|
|
updateStrategies(
|
2019-01-07 03:03:34 +00:00
|
|
|
strategies: [AuthenticationStrategyInput]!
|
2018-10-14 21:38:39 +00:00
|
|
|
): DefaultResponse @auth(requires: ["manage:system"])
|
2019-06-30 19:18:26 +00:00
|
|
|
|
|
|
|
regenerateCertificates: DefaultResponse @auth(requires: ["manage:system"])
|
2020-02-22 22:38:06 +00:00
|
|
|
|
2019-06-30 19:18:26 +00:00
|
|
|
resetGuestUser: DefaultResponse @auth(requires: ["manage:system"])
|
2018-03-06 01:53:24 +00:00
|
|
|
}
|
2018-03-05 20:49:36 +00:00
|
|
|
|
2018-03-10 05:58:04 +00:00
|
|
|
# -----------------------------------------------
|
|
|
|
# TYPES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
2018-06-04 04:41:29 +00:00
|
|
|
type AuthenticationStrategy {
|
2018-03-05 20:49:36 +00:00
|
|
|
key: String!
|
2020-07-03 23:36:33 +00:00
|
|
|
props: [KeyValuePair] @auth(requires: ["manage:system"])
|
2018-03-05 20:49:36 +00:00
|
|
|
title: String!
|
2018-08-04 21:27:55 +00:00
|
|
|
description: String
|
2019-04-21 00:49:05 +00:00
|
|
|
isAvailable: Boolean
|
2018-03-05 20:49:36 +00:00
|
|
|
useForm: Boolean!
|
2020-07-19 17:20:43 +00:00
|
|
|
usernameLabel: String
|
2018-08-04 21:27:55 +00:00
|
|
|
logo: String
|
2018-10-08 04:17:31 +00:00
|
|
|
color: String
|
2018-08-04 21:27:55 +00:00
|
|
|
website: String
|
2018-03-05 20:49:36 +00:00
|
|
|
icon: String
|
2020-07-03 23:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type AuthenticationActiveStrategy {
|
|
|
|
key: String!
|
|
|
|
strategy: AuthenticationStrategy!
|
|
|
|
displayName: String!
|
|
|
|
order: Int!
|
2018-10-08 04:17:31 +00:00
|
|
|
config: [KeyValuePair] @auth(requires: ["manage:system"])
|
2018-06-25 06:44:40 +00:00
|
|
|
selfRegistration: Boolean!
|
2018-10-08 04:17:31 +00:00
|
|
|
domainWhitelist: [String]! @auth(requires: ["manage:system"])
|
|
|
|
autoEnrollGroups: [Int]! @auth(requires: ["manage:system"])
|
2018-03-05 20:49:36 +00:00
|
|
|
}
|
2018-03-10 05:58:04 +00:00
|
|
|
|
|
|
|
type AuthenticationLoginResponse {
|
2018-03-25 02:35:47 +00:00
|
|
|
responseResult: ResponseStatus
|
2018-10-08 04:17:31 +00:00
|
|
|
jwt: String
|
2019-08-25 02:19:35 +00:00
|
|
|
mustChangePwd: Boolean
|
|
|
|
mustProvideTFA: Boolean
|
|
|
|
continuationToken: String
|
2020-07-19 19:13:35 +00:00
|
|
|
redirect: String
|
2018-03-10 05:58:04 +00:00
|
|
|
}
|
2018-06-26 00:55:00 +00:00
|
|
|
|
2018-12-17 05:51:52 +00:00
|
|
|
type AuthenticationRegisterResponse {
|
|
|
|
responseResult: ResponseStatus
|
|
|
|
jwt: String
|
|
|
|
}
|
|
|
|
|
2018-06-26 00:55:00 +00:00
|
|
|
input AuthenticationStrategyInput {
|
|
|
|
key: String!
|
2020-07-03 23:36:33 +00:00
|
|
|
strategyKey: String!
|
2018-06-26 00:55:00 +00:00
|
|
|
config: [KeyValuePairInput]
|
2020-07-03 23:36:33 +00:00
|
|
|
displayName: String!
|
|
|
|
order: Int!
|
2018-06-26 00:55:00 +00:00
|
|
|
selfRegistration: Boolean!
|
|
|
|
domainWhitelist: [String]!
|
|
|
|
autoEnrollGroups: [Int]!
|
|
|
|
}
|
2019-01-07 03:03:34 +00:00
|
|
|
|
2020-02-22 22:38:06 +00:00
|
|
|
type AuthenticationApiKey {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
keyShort: String!
|
|
|
|
expiration: Date!
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
isRevoked: Boolean!
|
|
|
|
}
|
|
|
|
|
|
|
|
type AuthenticationCreateApiKeyResponse {
|
|
|
|
responseResult: ResponseStatus
|
|
|
|
key: String
|
|
|
|
}
|