Skip to content

Commit

Permalink
Merge pull request #300 from privacybydesign/use-staging-keyshare-server
Browse files Browse the repository at this point in the history
CI/CD: use staging keyshare server instead of improvised test backend
  • Loading branch information
w-ensink authored Jan 22, 2025
2 parents cdfdf6c + 281697e commit 9f4bb6d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions integration_test/irma_binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ import 'package:rxdart/rxdart.dart';

/// Binding to use the static IrmaClientBridge in integration tests.
class IntegrationTestIrmaBinding {
static const String _testKeyshareSchemeId = 'pbdf-staging';
static const String _testKeyshareSchemeUrl = 'https://schemes.staging.yivi.app/pbdf-staging/';
static const String _testKeyshareSchemePublicKey = '''
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEOcIdNBdagVt4+obhRPsyS5K2ovGKENYW
iHcQ8HxZ7lYoPRfabEpqv+3zsbxb4RlHXJ0dIgPkcp2sLFJZ9VDBAvcZlohWGYRW
Nu1bRk5gLEwmR5+V6MSFQWyWBkwacOt8
-----END PUBLIC KEY-----
''';

static IntegrationTestIrmaBinding? _instance;

final IrmaClientBridge _bridge;
Expand Down Expand Up @@ -54,14 +64,13 @@ class IntegrationTestIrmaBinding {
}

// Ensure test scheme is available.
if (!currEnrollmentStatus.unenrolledSchemeManagerIds.contains('test')) {
if (!currEnrollmentStatus.unenrolledSchemeManagerIds.contains(_testKeyshareSchemeId)) {
_bridge.dispatch(InstallSchemeEvent(
url: 'https://drksn.nl/irma_configuration/test',
publicKey:
'-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0d8s6KCWffx7I8cpit7CgVEATFAp\nGBSdMEJFRp3aDhsk/N8hkbTTdtqJUNfK1WEDMnAURlWJM88BE6YIomAMUw==\n-----END PUBLIC KEY-----',
url: _testKeyshareSchemeUrl,
publicKey: _testKeyshareSchemePublicKey,
));
currEnrollmentStatus = await _expectBridgeEventGuarded<EnrollmentStatusEvent>();
if (!currEnrollmentStatus.unenrolledSchemeManagerIds.contains('test')) {
if (!currEnrollmentStatus.unenrolledSchemeManagerIds.contains(_testKeyshareSchemeId)) {
throw Exception('No test scheme installed');
}
}
Expand All @@ -84,7 +93,7 @@ class IntegrationTestIrmaBinding {
email: '',
pin: '12345',
language: 'en',
schemeId: 'test',
schemeId: _testKeyshareSchemeId,
));
await _preferences!.setLongPin(false);
await _expectBridgeEventGuarded((event) => event is EnrollmentSuccessEvent);
Expand All @@ -95,7 +104,7 @@ class IntegrationTestIrmaBinding {
_repository = IrmaRepository(
client: _bridge,
preferences: _preferences!,
defaultKeyshareScheme: 'test',
defaultKeyshareScheme: _testKeyshareSchemeId,
);
}

Expand Down

0 comments on commit 9f4bb6d

Please sign in to comment.