Skip to content

Commit 04f0c4b

Browse files
Fix app attestation provider values to match backend enum (#83)
Remove AppAttestationProvider enum from public API. Provider is now hardcoded internally by each native SDK (APP_ATTEST for iOS, PLAY_INTEGRITY for Android). AppAttestation interface now just takes token and optional keyId. Also bumps native SDK deps and version to 2.8.0-alpha.2.
1 parent 8595729 commit 04f0c4b

File tree

6 files changed

+4
-16
lines changed

6 files changed

+4
-16
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ dependencies {
6161

6262
implementation "androidx.browser:browser:1.2.0"
6363

64-
implementation("com.authsignal:authsignal-android:3.4.1-alpha.1")
64+
implementation("com.authsignal:authsignal-android:3.4.1-alpha.2")
6565
}

android/src/main/java/com/authsignal/react/AuthsignalInAppModule.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.authsignal.react
33
import android.util.Log
44
import com.authsignal.inapp.AuthsignalInApp
55
import com.authsignal.models.api.AppAttestation
6-
import com.authsignal.models.api.AppAttestationProvider
76
import com.facebook.react.bridge.Arguments
87
import com.facebook.react.bridge.Promise
98
import com.facebook.react.bridge.ReactApplicationContext
@@ -63,12 +62,8 @@ class AuthsignalInAppModule(private val reactContext: ReactApplicationContext) :
6362
) {
6463
val appAttestation = appAttestationMap?.let { map ->
6564
val attestationToken = map.getString("token") ?: return@let null
66-
val provider = when (map.getString("provider")) {
67-
"playIntegrity" -> AppAttestationProvider.PLAY_INTEGRITY
68-
else -> AppAttestationProvider.PLAY_INTEGRITY
69-
}
7065
val keyId = if (map.hasKey("keyId")) map.getString("keyId") else null
71-
AppAttestation(provider = provider, token = attestationToken, keyId = keyId)
66+
AppAttestation(token = attestationToken, keyId = keyId)
7267
}
7368

7469
launch(promise) {

ios/AuthsignalInAppModule.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class AuthsignalInAppModule: NSObject {
7777
if let dict = appAttestationDict,
7878
let attestationToken = dict["token"] as? String {
7979
appAttestation = AppAttestation(
80-
provider: .apple,
8180
token: attestationToken,
8281
keyId: dict["keyId"] as? String
8382
)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-authsignal",
3-
"version": "2.8.0-alpha.1",
3+
"version": "2.8.0-alpha.2",
44
"description": "The official Authsignal React Native library.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

react-native-authsignal.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
1818
s.private_header_files = "ios/**/*.h"
1919

2020
s.dependency "React-Core"
21-
s.dependency 'Authsignal', '2.4.0-alpha.1'
21+
s.dependency 'Authsignal', '2.4.0-alpha.2'
2222

2323
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
2424
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.

src/types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ export interface VerifyResponse {
4545
failureReason?: string;
4646
}
4747

48-
export enum AppAttestationProvider {
49-
apple = 'apple',
50-
playIntegrity = 'playIntegrity',
51-
}
52-
5348
export interface AppAttestation {
54-
provider: AppAttestationProvider;
5549
token: string;
5650
keyId?: string;
5751
}

0 commit comments

Comments
 (0)