Skip to content

Commit

Permalink
Merge pull request #6235 from artsy/second-factor-stitching
Browse files Browse the repository at this point in the history
feat: add unstitched second factor mutations
  • Loading branch information
mzikherman authored Nov 19, 2024
2 parents b5cd699 + e786f4b commit 5a96c61
Show file tree
Hide file tree
Showing 15 changed files with 718 additions and 99 deletions.
147 changes: 57 additions & 90 deletions _schemaV2.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1162,27 +1162,33 @@ type AnalyticsVisitorsByReferral {
value: Int!
}

# App Authenticator Two-Factor Authentication factor
type AppSecondFactor implements SecondFactor {
createdAt: ISO8601DateTime!
disabledAt: ISO8601DateTime
disabledAt(
format: String

# A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: String
): String
enabled: Boolean!
enabledAt: ISO8601DateTime
enabledAt(
format: String

# A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: String
): String

# A type-specific Gravity Mongo Document ID.
internalID: ID!
kind: SecondFactorKind!
name: String
otpProvisioningURI: String
otpSecret: String
updatedAt: ISO8601DateTime!
}

# Second factor input attributes
input AppSecondFactorAttributes {
# Name of the second factor
name: String
}

# An app second factor or errors
union AppSecondFactorOrErrorsUnion = AppSecondFactor | Errors

type Article implements Node {
Expand Down Expand Up @@ -3751,23 +3757,31 @@ type Author {
twitterHandle: String
}

# Backup Two-Factor Authentication factor
type BackupSecondFactor implements SecondFactor {
code: String!
createdAt: ISO8601DateTime!
disabledAt: ISO8601DateTime
disabledAt(
format: String

# A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: String
): String
enabled: Boolean!
enabledAt: ISO8601DateTime
enabledAt(
format: String

# A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: String
): String

# A type-specific Gravity Mongo Document ID.
internalID: ID!
kind: SecondFactorKind!
updatedAt: ISO8601DateTime!
}

type BackupSecondFactors {
secondFactors: [BackupSecondFactor!]!
}

# A list of backup second factors or errors
union BackupSecondFactorsOrErrorsUnion = BackupSecondFactors | Errors

type BankAccount {
Expand Down Expand Up @@ -7955,21 +7969,15 @@ input CreateAndSendBackupSecondFactorInput {
type CreateAndSendBackupSecondFactorPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
factor: BackupSecondFactor!
}

# Autogenerated input type of CreateAppSecondFactor
input CreateAppSecondFactorInput {
attributes: AppSecondFactorAttributes!

# A unique identifier for the client performing the mutation.
clientMutationId: String
password: String!
}

# Autogenerated return type of CreateAppSecondFactor
type CreateAppSecondFactorPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorOrErrors: AppSecondFactorOrErrorsUnion!
}
Expand Down Expand Up @@ -8002,16 +8010,12 @@ type CreateArtistSuccess {

union CreateArtistSuccessOrErrorType = CreateArtistFailure | CreateArtistSuccess

# Autogenerated input type of CreateBackupSecondFactors
input CreateBackupSecondFactorsInput {
# A unique identifier for the client performing the mutation.
clientMutationId: String
password: String!
}

# Autogenerated return type of CreateBackupSecondFactors
type CreateBackupSecondFactorsPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorsOrErrors: BackupSecondFactorsOrErrorsUnion!
}
Expand Down Expand Up @@ -8427,18 +8431,13 @@ type CreateSaleAgreementSuccess {
saleAgreement: SaleAgreement
}

# Autogenerated input type of CreateSmsSecondFactor
input CreateSmsSecondFactorInput {
attributes: SmsSecondFactorAttributes!

# A unique identifier for the client performing the mutation.
clientMutationId: String
password: String!
}

# Autogenerated return type of CreateSmsSecondFactor
type CreateSmsSecondFactorPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorOrErrors: SmsSecondFactorOrErrorsUnion!
}
Expand Down Expand Up @@ -9190,16 +9189,12 @@ type DeleteViewingRoomPayload {
viewingRoom: ViewingRoom!
}

# Autogenerated input type of DeliverSecondFactor
input DeliverSecondFactorInput {
# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorID: ID!
}

# Autogenerated return type of DeliverSecondFactor
type DeliverSecondFactorPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorOrErrors: SecondFactorOrErrorsUnion!
}
Expand Down Expand Up @@ -9267,17 +9262,13 @@ type Device {
token: String!
}

# Autogenerated input type of DisableSecondFactor
input DisableSecondFactorInput {
# A unique identifier for the client performing the mutation.
clientMutationId: String
password: String!
secondFactorID: ID!
}

# Autogenerated return type of DisableSecondFactor
type DisableSecondFactorPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorOrErrors: SecondFactorOrErrorsUnion!
}
Expand Down Expand Up @@ -9425,18 +9416,14 @@ enum EditionSetSorts {
PRICE_ASC
}

# Autogenerated input type of EnableSecondFactor
input EnableSecondFactorInput {
# A unique identifier for the client performing the mutation.
clientMutationId: String
code: String!
password: String!
secondFactorID: ID!
}

# Autogenerated return type of EnableSecondFactor
type EnableSecondFactorPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
recoveryCodes: [String!]
secondFactorOrErrors: SecondFactorOrErrorsUnion!
Expand Down Expand Up @@ -13740,14 +13727,12 @@ type Mutation {
input: CreateAndSendBackupSecondFactorInput!
): CreateAndSendBackupSecondFactorPayload
createAppSecondFactor(
# Parameters for CreateAppSecondFactor
input: CreateAppSecondFactorInput!
): CreateAppSecondFactorPayload

# Create an artist
createArtist(input: CreateArtistMutationInput!): CreateArtistMutationPayload
createBackupSecondFactors(
# Parameters for CreateBackupSecondFactors
input: CreateBackupSecondFactorsInput!
): CreateBackupSecondFactorsPayload
createBankDebitSetup(
Expand Down Expand Up @@ -13857,7 +13842,6 @@ type Mutation {
input: CreateSaleAgreementMutationInput!
): CreateSaleAgreementMutationPayload
createSmsSecondFactor(
# Parameters for CreateSmsSecondFactor
input: CreateSmsSecondFactorInput!
): CreateSmsSecondFactorPayload
createUserAddress(
Expand Down Expand Up @@ -14007,11 +13991,9 @@ type Mutation {
input: DeleteViewingRoomInput!
): DeleteViewingRoomPayload
deliverSecondFactor(
# Parameters for DeliverSecondFactor
input: DeliverSecondFactorInput!
): DeliverSecondFactorPayload
disableSecondFactor(
# Parameters for DisableSecondFactor
input: DisableSecondFactorInput!
): DisableSecondFactorPayload

Expand All @@ -14020,10 +14002,7 @@ type Mutation {

# Updates a Task on the logged in User
dismissTask(input: DismissTaskMutationInput!): DismissTaskMutationPayload
enableSecondFactor(
# Parameters for EnableSecondFactor
input: EnableSecondFactorInput!
): EnableSecondFactorPayload
enableSecondFactor(input: EnableSecondFactorInput!): EnableSecondFactorPayload

# Mark sale as ended.
endSale(input: EndSaleInput!): EndSalePayload
Expand Down Expand Up @@ -14163,7 +14142,6 @@ type Mutation {
# Create an alert
updateAlert(input: updateAlertInput!): updateAlertPayload
updateAppSecondFactor(
# Parameters for UpdateAppSecondFactor
input: UpdateAppSecondFactorInput!
): UpdateAppSecondFactorPayload

Expand Down Expand Up @@ -14266,7 +14244,6 @@ type Mutation {
input: UpdateSaleAgreementMutationInput!
): UpdateSaleAgreementMutationPayload
updateSmsSecondFactor(
# Parameters for UpdateSmsSecondFactor
input: UpdateSmsSecondFactorInput!
): UpdateSmsSecondFactorPayload

Expand Down Expand Up @@ -16359,11 +16336,6 @@ type Query {
# Find partners by IDs
_unused_gravity_partners(ids: [ID!]!): [DoNotUseThisPartner!]

# List enabled Two-Factor Authentication factors
_unused_gravity_secondFactors(
kinds: [SecondFactorKind!] = [app, sms, backup]
): [SecondFactor!]!

# List of user's saved addresses
_unused_gravity_userAddressConnection(
# Returns the elements in the list that come after the specified cursor.
Expand Down Expand Up @@ -18681,28 +18653,31 @@ type SearchableItem implements Node & Searchable {
}

interface SecondFactor {
createdAt: ISO8601DateTime!
disabledAt: ISO8601DateTime
disabledAt(
format: String

# A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: String
): String
enabled: Boolean!
enabledAt: ISO8601DateTime
enabledAt(
format: String

# A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: String
): String

# A type-specific Gravity Mongo Document ID.
internalID: ID!
kind: SecondFactorKind!
updatedAt: ISO8601DateTime!
}

# Two-Factor Authentication (2FA) Method
enum SecondFactorKind {
# App authenticator 2FA method
app

# Backup 2FA method
backup

# SMS 2FA method
sms
}

# A second factor or errors
union SecondFactorOrErrorsUnion = AppSecondFactor | Errors | SmsSecondFactor

# A piece that can be sold
Expand Down Expand Up @@ -19222,32 +19197,34 @@ enum ShowSorts {
UPDATED_AT_DESC
}

# SMS Two-Factor Authentication factor
type SmsSecondFactor implements SecondFactor {
countryCode: String
createdAt: ISO8601DateTime!
disabledAt: ISO8601DateTime
disabledAt(
format: String

# A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: String
): String
enabled: Boolean!
enabledAt: ISO8601DateTime
enabledAt(
format: String

# A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: String
): String
formattedPhoneNumber: String

# A type-specific Gravity Mongo Document ID.
internalID: ID!
kind: SecondFactorKind!
lastDeliveredAt: ISO8601DateTime
maskedPhone: String @deprecated(reason: "Use formattedPhoneNumber instead")
phoneNumber: String
updatedAt: ISO8601DateTime!
}

# SMS second factor input attributes
input SmsSecondFactorAttributes {
# ISO 3166 country code for the SMS second factor
countryCode: String

# Phone number of the SMS second factor
phoneNumber: String
}

# An SMS second factor or errors
union SmsSecondFactorOrErrorsUnion = Errors | SmsSecondFactor

type SpecialistBio {
Expand Down Expand Up @@ -19684,18 +19661,13 @@ type UpdateAlertSuccess {
alert: Alert
}

# Autogenerated input type of UpdateAppSecondFactor
input UpdateAppSecondFactorInput {
attributes: AppSecondFactorAttributes!

# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorID: ID!
}

# Autogenerated return type of UpdateAppSecondFactor
type UpdateAppSecondFactorPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorOrErrors: AppSecondFactorOrErrorsUnion!
}
Expand Down Expand Up @@ -20328,18 +20300,13 @@ type UpdateSaleAgreementSuccess {
saleAgreement: SaleAgreement
}

# Autogenerated input type of UpdateSmsSecondFactor
input UpdateSmsSecondFactorInput {
attributes: SmsSecondFactorAttributes!

# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorID: ID!
}

# Autogenerated return type of UpdateSmsSecondFactor
type UpdateSmsSecondFactorPayload {
# A unique identifier for the client performing the mutation.
clientMutationId: String
secondFactorOrErrors: SmsSecondFactorOrErrorsUnion!
}
Expand Down
Loading

0 comments on commit 5a96c61

Please sign in to comment.