Unverified password identities were able to open sessions after signing out. Reject sign-in with EMAIL_NOT_VERIFIED and add a resend-confirmation flow so users can complete verification. Signed-off-by: Émile Ré <emile@probo.com>
203 lines
4.3 KiB
GraphQL
203 lines
4.3 KiB
GraphQL
enum ReauthenticationReason {
|
|
SESSION_EXPIRED
|
|
SENSITIVE_ACTION
|
|
POLICY_REQUIREMENT
|
|
}
|
|
|
|
extend type Mutation {
|
|
signIn(input: SignInInput!): SignInPayload @authentication(required: OPTIONAL)
|
|
signUp(input: SignUpInput!): SignUpPayload @authentication(required: NONE)
|
|
signOut: SignOutPayload @authentication(required: PRESENT) @sessionOnly
|
|
activateAccount(
|
|
input: ActivateAccountInput!
|
|
): ActivateAccountPayload @authentication(required: OPTIONAL)
|
|
forgotPassword(input: ForgotPasswordInput!): ForgotPasswordPayload
|
|
@authentication(required: NONE)
|
|
resetPassword(input: ResetPasswordInput!): ResetPasswordPayload
|
|
@authentication(required: NONE)
|
|
verifyEmail(input: VerifyEmailInput!): VerifyEmailPayload
|
|
@authentication(required: OPTIONAL)
|
|
resendVerificationEmail(
|
|
input: ResendVerificationEmailInput!
|
|
): ResendVerificationEmailPayload @authentication(required: NONE)
|
|
changePassword(input: ChangePasswordInput!): ChangePasswordPayload
|
|
@authentication(required: PRESENT) @sessionOnly
|
|
changeEmail(input: ChangeEmailInput!): ChangeEmailPayload
|
|
@authentication(required: PRESENT) @sessionOnly
|
|
assumeOrganizationSession(
|
|
input: AssumeOrganizationSessionInput!
|
|
): AssumeOrganizationSessionPayload @authentication(required: PRESENT) @sessionOnly
|
|
|
|
revokeSession(input: RevokeSessionInput!): RevokeSessionPayload!
|
|
@authentication(required: PRESENT) @sessionOnly
|
|
revokeAllSessions: RevokeAllSessionsPayload @authentication(required: PRESENT) @sessionOnly
|
|
}
|
|
|
|
enum SessionOrderField
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.SessionOrderField") {
|
|
CREATED_AT
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.SessionOrderFieldCreatedAt")
|
|
EXPIRED_AT
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.SessionOrderFieldExpiredAt")
|
|
UPDATED_AT
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.SessionOrderFieldUpdatedAt")
|
|
}
|
|
|
|
input SessionOrder {
|
|
direction: OrderDirection!
|
|
field: SessionOrderField!
|
|
}
|
|
|
|
type Session implements Node {
|
|
id: ID!
|
|
identity: Identity @goField(forceResolver: true)
|
|
ipAddress: String!
|
|
userAgent: String!
|
|
updatedAt: Datetime!
|
|
createdAt: Datetime!
|
|
expiresAt: Datetime!
|
|
|
|
permission(action: String!): Boolean!
|
|
@goField(forceResolver: true)
|
|
@authentication(required: PRESENT)
|
|
}
|
|
|
|
type SessionConnection
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.SessionConnection"
|
|
) {
|
|
edges: [SessionEdge!]!
|
|
pageInfo: PageInfo!
|
|
totalCount: Int @goField(forceResolver: true)
|
|
}
|
|
|
|
type SessionEdge {
|
|
node: Session!
|
|
cursor: CursorKey!
|
|
}
|
|
|
|
input SignInInput {
|
|
organizationId: ID
|
|
email: EmailAddr!
|
|
password: String!
|
|
}
|
|
|
|
input SignUpInput {
|
|
email: EmailAddr!
|
|
password: String!
|
|
fullName: String!
|
|
}
|
|
|
|
input ActivateAccountInput {
|
|
token: String!
|
|
}
|
|
|
|
input ForgotPasswordInput {
|
|
email: EmailAddr!
|
|
}
|
|
|
|
input ResetPasswordInput {
|
|
token: String!
|
|
password: String!
|
|
}
|
|
|
|
input VerifyEmailInput {
|
|
token: String!
|
|
}
|
|
|
|
input ResendVerificationEmailInput {
|
|
email: EmailAddr!
|
|
}
|
|
|
|
input ChangePasswordInput {
|
|
currentPassword: String!
|
|
newPassword: String!
|
|
}
|
|
|
|
input ChangeEmailInput {
|
|
newEmail: EmailAddr!
|
|
password: String!
|
|
}
|
|
|
|
input AssumeOrganizationSessionInput {
|
|
organizationId: ID!
|
|
continue: String!
|
|
}
|
|
|
|
input RevokeSessionInput {
|
|
sessionId: ID!
|
|
}
|
|
|
|
type SignInPayload {
|
|
identity: Identity
|
|
session: Session
|
|
}
|
|
|
|
type SignUpPayload {
|
|
identity: Identity
|
|
}
|
|
|
|
type SignOutPayload {
|
|
success: Boolean!
|
|
}
|
|
|
|
type ActivateAccountPayload {
|
|
createPasswordToken: String
|
|
ssoLoginUrl: String
|
|
profile: Profile
|
|
}
|
|
|
|
type ForgotPasswordPayload {
|
|
success: Boolean!
|
|
}
|
|
|
|
type ResetPasswordPayload {
|
|
success: Boolean!
|
|
}
|
|
|
|
type VerifyEmailPayload {
|
|
success: Boolean!
|
|
}
|
|
|
|
type ResendVerificationEmailPayload {
|
|
success: Boolean!
|
|
}
|
|
|
|
type ChangePasswordPayload {
|
|
success: Boolean!
|
|
}
|
|
|
|
type ChangeEmailPayload {
|
|
success: Boolean!
|
|
}
|
|
|
|
union AssumeOrganizationSessionResult =
|
|
| OrganizationSessionCreated
|
|
| PasswordRequired
|
|
| SAMLAuthenticationRequired
|
|
|
|
type OrganizationSessionCreated {
|
|
session: Session!
|
|
membership: Membership!
|
|
}
|
|
|
|
type PasswordRequired {
|
|
reason: ReauthenticationReason!
|
|
}
|
|
|
|
type SAMLAuthenticationRequired {
|
|
reason: ReauthenticationReason!
|
|
}
|
|
|
|
type AssumeOrganizationSessionPayload {
|
|
result: AssumeOrganizationSessionResult!
|
|
}
|
|
|
|
type RevokeSessionPayload {
|
|
success: Boolean!
|
|
}
|
|
|
|
type RevokeAllSessionsPayload {
|
|
revokedCount: Int!
|
|
}
|