Skip to content

Commit

Permalink
Merge branch 'main' into feat/cip509-metadata-indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
saibatizoku authored Sep 24, 2024
2 parents b708dd7 + d728f10 commit 8cf87df
Show file tree
Hide file tree
Showing 38 changed files with 1,163 additions and 80 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ permissions:

jobs:
ci:
uses: input-output-hk/catalyst-ci/.github/workflows/ci.yml@master
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@master
with:
aws_ecr_registry: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
aws_role_arn: arn:aws:iam::332405224602:role/ci
aws_region: eu-central-1
secrets:
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
earthly_runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
forge_version: latest
51 changes: 51 additions & 0 deletions blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "1.0"
global: {
ci: {
local: [
"^check(-.*)?$",
"^build(-.*)?$",
"^package(-.*)?$",
"^test(-.*)?$",
"^release(-.*)?$",
"^publish(-.*)?$",
]
registries: [
ci.providers.aws.registry,
]
providers: {
aws: {
region: "eu-central-1"
registry: "332405224602.dkr.ecr.eu-central-1.amazonaws.com"
role: "arn:aws:iam::332405224602:role/ci"
}

docker: credentials: {
provider: "aws"
path: "global/ci/docker"
}

earthly: {
credentials: {
provider: "aws"
path: "global/ci/earthly"
}
org: "Catalyst"
satellite: "ci"
version: "0.8.15"
}

github: registry: "ghcr.io"
}
secrets: [
{
name: "GITHUB_TOKEN"
optional: true
provider: "env"
path: "GITHUB_TOKEN"
},
]
tagging: {
strategy: "commit"
}
}
}
2 changes: 2 additions & 0 deletions catalyst-gateway/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "1.0.0"
project: name: "gateway"
2 changes: 2 additions & 0 deletions catalyst-gateway/event-db/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "1.0.0"
project: name: "gateway-event-db"
2 changes: 2 additions & 0 deletions catalyst-gateway/tests/api_tests/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "1.0.0"
project: name: "gateway-api-tests"
2 changes: 2 additions & 0 deletions catalyst-gateway/tests/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "1.0.0"
project: name: "catalyst-gateway-tests"
2 changes: 2 additions & 0 deletions catalyst-gateway/tests/schemathesis_tests/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "1.0.0"
project: name: "gateway-schema-tests"
6 changes: 4 additions & 2 deletions catalyst_voices/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ package:

publish:
FROM +package
ARG tag='latest'

SAVE IMAGE voices-frontend:$tag
ARG container="voices"
ARG tag="latest"

SAVE IMAGE ${container}:${tag}
2 changes: 2 additions & 0 deletions catalyst_voices/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "1.0.0"
project: name: "voices"
8 changes: 4 additions & 4 deletions catalyst_voices/lib/dependency/dependencies.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ final class Dependencies extends DependencyProvider {
void _registerRepositories() {
this
..registerSingleton<CredentialsStorageRepository>(
CredentialsStorageRepository(secureStorageService: get()),
CredentialsStorageRepository(storage: get()),
)
..registerSingleton<AuthenticationRepository>(
AuthenticationRepository(credentialsStorageRepository: get()),
);
}

void _registerServices() {
registerSingleton<SecureStorageService>(
SecureStorageService(),
);
registerSingleton<Storage>(const SecureStorage());
registerSingleton<Vault>(const SecureStorageVault());
registerSingleton<DummyAuthStorage>(const SecureDummyAuthStorage());
}
}
13 changes: 12 additions & 1 deletion catalyst_voices/lib/pages/discovery/discovery_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:catalyst_voices/pages/discovery/current_status_text.dart';
import 'package:catalyst_voices/pages/discovery/toggle_state_text.dart';
import 'package:catalyst_voices/widgets/widgets.dart';
Expand Down Expand Up @@ -84,7 +86,16 @@ class _Segment extends StatelessWidget {
const Spacer(),
VoicesFilledButton(
child: const Text('CTA to Model'),
onTap: () {},
onTap: () {
unawaited(
VoicesDialog.show<void>(
context: context,
builder: (context) {
return const VoicesDesktopInfoDialog(title: Text(''));
},
),
);
},
),
],
),
Expand Down
11 changes: 9 additions & 2 deletions catalyst_voices/lib/routes/guards/milestone_guard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ final class MilestoneGuard implements RouteGuard {

@override
FutureOr<String?> redirect(BuildContext context, GoRouterState state) {
final location = state.uri.toString();

// redirects /m4 page to /m4/discovery
if (location == '/${Routes.currentMilestone}') {
return const DiscoveryRoute().location;
}

// allow milestone sub pages
if (state.uri.toString().startsWith('/${Routes.currentMilestone}')) {
if (location.startsWith('/${Routes.currentMilestone}')) {
return null;
}

// if already at destination skip redirect
if (state.uri.toString() == const ComingSoonRoute().location) {
if (location == const ComingSoonRoute().location) {
return null;
}

Expand Down
14 changes: 7 additions & 7 deletions catalyst_voices/lib/routes/routing/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import 'package:go_router/go_router.dart';
abstract final class Routes {
static const currentMilestone = 'm4';

static final List<RouteBase> routes = [
...coming_soon.$appRoutes,
...login.$appRoutes,
...spaces.$appRoutes,
...overall_spaces.$appRoutes,
];

static String get initialLocation {
return const coming_soon.ComingSoonRoute().location;
}

static List<RouteBase> get routes => [
...coming_soon.$appRoutes,
...login.$appRoutes,
...spaces.$appRoutes,
...overall_spaces.$appRoutes,
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import 'package:flutter_bloc/flutter_bloc.dart';

/// Manages the user session.
final class SessionBloc extends Bloc<SessionEvent, SessionState> {
SessionBloc() : super(const VisitorSessionState()) {
SessionBloc()
: super(
const ActiveUserSessionState(
user: User(name: 'Account'),
),
) {
on<SessionEvent>(_handleSessionEvent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,8 @@ ThemeData _buildThemeData(
backgroundColor: voicesColorScheme.onSurfaceNeutralOpaqueLv0,
),
dialogTheme: DialogTheme(
// TODO(damian-molinski): themed value needed.
// We don't have it defined yet.
barrierColor: const Color(0x612A3D61),
// N10-38
barrierColor: const Color(0x212A3D61),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
clipBehavior: Clip.hardEdge,
backgroundColor: voicesColorScheme.elevationsOnSurfaceNeutralLv1White,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,18 @@ import 'package:result_type/result_type.dart';
/// It will be replaced by a proper implementation as soon as authentication
/// flow will be defined.
final class CredentialsStorageRepository {
final SecureStorageService secureStorageService;
final DummyAuthStorage _storage;

const CredentialsStorageRepository({required this.secureStorageService});
const CredentialsStorageRepository({
required DummyAuthStorage storage,
}) : _storage = storage;

void get clearSessionData => secureStorageService.deleteAll;
Future<void> get clearSessionData async => _storage.clear();

Future<Result<SessionData?, SecureStorageError>> getSessionData() async {
try {
final email = await secureStorageService.get(
SecureStorageKeysConst.dummyEmail,
);

final password = await secureStorageService.get(
SecureStorageKeysConst.dummyPassword,
);
final email = await _storage.readEmail();
final password = await _storage.readPassword();

if (email == null || password == null) {
return Success(null);
Expand All @@ -44,15 +41,8 @@ final class CredentialsStorageRepository {
SessionData sessionData,
) async {
try {
await secureStorageService.set(
SecureStorageKeysConst.dummyEmail,
sessionData.email,
);

await secureStorageService.set(
SecureStorageKeysConst.dummyPassword,
sessionData.password,
);
await _storage.writeEmail(sessionData.email);
await _storage.writePassword(sessionData.password);
return Success(null);
} on SecureStorageError catch (_) {
return Failure(SecureStorageError.canNotSaveData);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
export 'secure_storage/secure_storage.dart';
export 'storage/dummy_auth_storage.dart';
export 'storage/secure_storage.dart';
export 'storage/storage.dart';
export 'storage/vault/lock_factor.dart';
export 'storage/vault/lock_factor_codec.dart' show LockFactorCodec;
export 'storage/vault/secure_storage_vault.dart';
export 'storage/vault/vault.dart';

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'dart:async';

import 'package:catalyst_voices_services/src/storage/secure_storage.dart';

abstract interface class DummyAuthStorage {
FutureOr<String?> readEmail();

FutureOr<void> writeEmail(String? value);

FutureOr<String?> readPassword();

FutureOr<void> writePassword(String? value);

Future<void> clear();
}

final class SecureDummyAuthStorage extends SecureStorage
implements DummyAuthStorage {
static const _emailKey = 'email';
static const _passwordKey = 'password';

const SecureDummyAuthStorage({
super.secureStorage,
});

@override
FutureOr<String?> readEmail() => readString(key: _emailKey);

@override
FutureOr<void> writeEmail(String? value) {
return writeString(value, key: _emailKey);
}

@override
FutureOr<String?> readPassword() => readString(key: _passwordKey);

@override
FutureOr<void> writePassword(String? value) {
return writeString(value, key: _passwordKey);
}

@override
Future<void> clear() async {
await writeEmail(null);
await writePassword(null);
}
}
Loading

0 comments on commit 8cf87df

Please sign in to comment.