Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI/CD: use staging keyshare server instead of improvised test backend #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading