diff --git a/js/packages/core/src/types/result.ts b/js/packages/core/src/types/result.ts index a38c8336..7181a9b0 100644 --- a/js/packages/core/src/types/result.ts +++ b/js/packages/core/src/types/result.ts @@ -51,6 +51,7 @@ export enum IDKitErrorCodes { TimestampTooFarInFuture = "timestamp_too_far_in_future", InvalidTimestamp = "invalid_timestamp", RpSignatureExpired = "rp_signature_expired", + IdentityAttributesNotMatched = "identity_attributes_not_matched", GenericError = "generic_error", // Client-side errors InvalidRpIdFormat = "invalid_rp_id_format", diff --git a/kotlin/bindings/src/main/kotlin/com/worldcoin/idkit/IdKit.kt b/kotlin/bindings/src/main/kotlin/com/worldcoin/idkit/IdKit.kt index a4927d2e..5257b678 100644 --- a/kotlin/bindings/src/main/kotlin/com/worldcoin/idkit/IdKit.kt +++ b/kotlin/bindings/src/main/kotlin/com/worldcoin/idkit/IdKit.kt @@ -63,6 +63,7 @@ enum class IDKitErrorCode(val rawValue: String) { TIMESTAMP_TOO_FAR_IN_FUTURE("timestamp_too_far_in_future"), INVALID_TIMESTAMP("invalid_timestamp"), RP_SIGNATURE_EXPIRED("rp_signature_expired"), + IDENTITY_ATTRIBUTES_NOT_MATCHED("identity_attributes_not_matched"), GENERIC_ERROR("generic_error"), TIMEOUT("timeout"), CANCELLED("cancelled"); @@ -91,6 +92,7 @@ enum class IDKitErrorCode(val rawValue: String) { AppError.TIMESTAMP_TOO_FAR_IN_FUTURE -> TIMESTAMP_TOO_FAR_IN_FUTURE AppError.INVALID_TIMESTAMP -> INVALID_TIMESTAMP AppError.RP_SIGNATURE_EXPIRED -> RP_SIGNATURE_EXPIRED + AppError.IDENTITY_ATTRIBUTES_NOT_MATCHED -> IDENTITY_ATTRIBUTES_NOT_MATCHED AppError.GENERIC_ERROR -> GENERIC_ERROR } } diff --git a/rust/core/src/error.rs b/rust/core/src/error.rs index b11ad3be..2f2488f1 100644 --- a/rust/core/src/error.rs +++ b/rust/core/src/error.rs @@ -154,6 +154,10 @@ pub enum AppError { #[error("RP signature expired")] RpSignatureExpired, + /// Identity attributes did not match the required values + #[error("Identity attributes not matched")] + IdentityAttributesNotMatched, + /// Generic error #[error("An error occurred")] #[serde(other)] @@ -187,6 +191,7 @@ impl AppError { "timestamp_too_far_in_future" => Self::TimestampTooFarInFuture, "invalid_timestamp" => Self::InvalidTimestamp, "rp_signature_expired" => Self::RpSignatureExpired, + "identity_attributes_not_matched" => Self::IdentityAttributesNotMatched, _ => Self::GenericError, } } diff --git a/rust/core/src/wasm_bindings.rs b/rust/core/src/wasm_bindings.rs index aaa78d5c..2f4b2b01 100644 --- a/rust/core/src/wasm_bindings.rs +++ b/rust/core/src/wasm_bindings.rs @@ -1447,6 +1447,7 @@ export type IDKitErrorCode = | "timestamp_too_far_in_future" | "invalid_timestamp" | "rp_signature_expired" + | "identity_attributes_not_matched" | "generic_error"; /** Status returned from pollForStatus() */ diff --git a/swift/Sources/IDKit/IDKit.swift b/swift/Sources/IDKit/IDKit.swift index 8a011e46..2ca63ab2 100644 --- a/swift/Sources/IDKit/IDKit.swift +++ b/swift/Sources/IDKit/IDKit.swift @@ -124,6 +124,7 @@ public enum IDKitErrorCode: String, Equatable { case timestampTooFarInFuture = "timestamp_too_far_in_future" case invalidTimestamp = "invalid_timestamp" case rpSignatureExpired = "rp_signature_expired" + case identityAttributesNotMatched = "identity_attributes_not_matched" case genericError = "generic_error" case timeout = "timeout" case cancelled = "cancelled" @@ -174,6 +175,8 @@ public enum IDKitErrorCode: String, Equatable { .invalidTimestamp case .rpSignatureExpired: .rpSignatureExpired + case .identityAttributesNotMatched: + .identityAttributesNotMatched case .genericError: .genericError }