wikijs-fork/server/graph/schemas/authentication.graphql

145 lines
3.4 KiB
GraphQL
Raw Normal View History

# ===============================================
# AUTHENTICATION
# ===============================================
extend type Query {
authentication: AuthenticationQuery
}
extend type Mutation {
authentication: AuthenticationMutation
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type AuthenticationQuery {
apiKeys: [AuthenticationApiKey] @auth(requires: ["manage:system", "manage:api"])
apiState: Boolean! @auth(requires: ["manage:system", "manage:api"])
strategies: [AuthenticationStrategy] @auth(requires: ["manage:system"])
activeStrategies: [AuthenticationActiveStrategy]
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type AuthenticationMutation {
createApiKey(
name: String!
expiration: String!
fullAccess: Boolean!
group: Int
): AuthenticationCreateApiKeyResponse @auth(requires: ["manage:system", "manage:api"])
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)
loginTFA(
continuationToken: String!
securityCode: String!
): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
loginChangePassword(
continuationToken: String!
newPassword: String!
): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
register(
email: String!
password: String!
name: String!
): AuthenticationRegisterResponse
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"])
regenerateCertificates: DefaultResponse @auth(requires: ["manage:system"])
resetGuestUser: DefaultResponse @auth(requires: ["manage:system"])
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
2018-06-04 04:41:29 +00:00
type AuthenticationStrategy {
key: String!
props: [KeyValuePair] @auth(requires: ["manage:system"])
title: String!
2018-08-04 21:27:55 +00:00
description: String
isAvailable: Boolean
useForm: Boolean!
usernameLabel: String
2018-08-04 21:27:55 +00:00
logo: String
color: String
2018-08-04 21:27:55 +00:00
website: String
icon: String
}
type AuthenticationActiveStrategy {
key: String!
strategy: AuthenticationStrategy!
displayName: String!
order: Int!
config: [KeyValuePair] @auth(requires: ["manage:system"])
selfRegistration: Boolean!
domainWhitelist: [String]! @auth(requires: ["manage:system"])
autoEnrollGroups: [Int]! @auth(requires: ["manage:system"])
}
type AuthenticationLoginResponse {
responseResult: ResponseStatus
jwt: String
mustChangePwd: Boolean
mustProvideTFA: Boolean
continuationToken: String
2020-07-19 19:13:35 +00:00
redirect: String
}
2018-06-26 00:55:00 +00:00
type AuthenticationRegisterResponse {
responseResult: ResponseStatus
jwt: String
}
2018-06-26 00:55:00 +00:00
input AuthenticationStrategyInput {
key: String!
strategyKey: String!
2018-06-26 00:55:00 +00:00
config: [KeyValuePairInput]
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
type AuthenticationApiKey {
id: Int!
name: String!
keyShort: String!
expiration: Date!
createdAt: Date!
updatedAt: Date!
isRevoked: Boolean!
}
type AuthenticationCreateApiKeyResponse {
responseResult: ResponseStatus
key: String
}