Added PAT support

This commit is contained in:
Wyatt Johnson
2017-06-15 18:12:53 -04:00
parent 0c7f9cdb1e
commit b78d4f29ea
13 changed files with 343 additions and 2 deletions
+57
View File
@@ -36,6 +36,23 @@ enum USER_ROLES {
MODERATOR
}
# Token is a personal access token associated with a given user.
type Token {
# ID is the unique identifier for the token.
id: ID!
# Name is the description for the token.
name: String!
# Active determines if the token is available to hit the API.
active: Boolean!
# JWT is the actual token to use for authentication, this is only available
# on token creation, otherwise it will be null.
jwt: String
}
type UserProfile {
# the id is an identifier for the user profile (email, facebook id, etc)
id: String!
@@ -78,6 +95,9 @@ type User {
# ignored users.
ignoredUsers: [User!]
# Tokens are the personal access tokens for a given user.
tokens: [Token!]
# returns all comments based on a query.
comments(query: CommentsQuery): CommentConnection!
@@ -889,6 +909,37 @@ type EditCommentResponse implements Response {
errors: [UserError!]
}
# CreateTokenInput contains the input to create the token.
input CreateTokenInput {
# Name is the description for the token.
name: String!
}
# CreateTokenResponse contains the errors related to creating a token.
type CreateTokenResponse implements Response {
# Token is the Token that was created, or null if it failed.
token: Token
# An array of errors relating to the mutation that occured.
errors: [UserError!]
}
# RevokeTokenInput contains the input to revoke the token.
input RevokeTokenInput {
# ID is the JTI for the token.
id: ID!
}
# RevokeTokenResponse contains the errors related to revoking a token.
type RevokeTokenResponse implements Response {
# An array of errors relating to the mutation that occured.
errors: [UserError!]
}
# All mutations for the application are defined on this object.
type RootMutation {
@@ -928,6 +979,12 @@ type RootMutation {
# Ignore comments by another user
ignoreUser(id: ID!): IgnoreUserResponse
# CreateToken will create a token that is attached to the current user.
createToken(input: CreateTokenInput!): CreateTokenResponse!
# RevokeToken will revoke an existing token.
revokeToken(input: RevokeTokenInput!): RevokeTokenResponse!
# Stop Ignoring comments by another user
stopIgnoringUser(id: ID!): StopIgnoringUserResponse
}