Skip to content

Commit

Permalink
feat: Add cred manifest switch and added enterprise model
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Dec 8, 2023
1 parent 515843d commit e94bf1f
Show file tree
Hide file tree
Showing 15 changed files with 442 additions and 6 deletions.
2 changes: 2 additions & 0 deletions lib/app/shared/constants/secure_storage_keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class SecureStorageKeys {
static const String enableJWKThumbprint = 'enableJWKThumbprint';
static const String enableCryptographicHolderBinding =
'enableCryptographicHolderBinding';
static const String enableCredentialManifestSupport =
'enableCredentialManifestSupport';
static const String enableScopeParameter = 'enableScopeParameter';
static const String useBasicClientAuthentication = 'isPreRegisteredWallet';
static const String clientId = 'clientId';
Expand Down
309 changes: 309 additions & 0 deletions lib/app/shared/models/enterprise_option/enterprise_option.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';

part 'enterprise_option.g.dart';

@JsonSerializable()
class EnterpriseOption extends Equatable {
const EnterpriseOption({
this.blockchainOptions,
this.exp,
this.generalOptions,
this.helpCenterOptions,
this.iat,
this.iss,
this.jti,
this.published,
this.selfSovereignIdentityOptions,
this.settingsMenu,
this.version,
this.walletSecurityOptions,
});

factory EnterpriseOption.fromJson(Map<String, dynamic> json) =>
_$EnterpriseOptionFromJson(json);

final BlockchainOptions? blockchainOptions;
final int? exp;
final GeneralOptions? generalOptions;
final HelpCenterOptions? helpCenterOptions;
final int? iat;
final String? iss;
final String? jti;
final DateTime? published;
final SelfSovereignIdentityOptions? selfSovereignIdentityOptions;
final SettingsMenu? settingsMenu;
final String? version;
final WalletSecurityOptions? walletSecurityOptions;

Map<String, dynamic> toJson() => _$EnterpriseOptionToJson(this);

@override
List<Object?> get props => [
blockchainOptions,
exp,
generalOptions,
helpCenterOptions,
iat,
iss,
jti,
published,
selfSovereignIdentityOptions,
settingsMenu,
version,
walletSecurityOptions,
];
}

@JsonSerializable()
class BlockchainOptions extends Equatable {
const BlockchainOptions({
this.bnbSupport,
this.ethereumSupport,
this.fantomSupport,
this.hederaSupport,
this.infuraApiKey,
this.infuraRpcNode,
this.polygonSupport,
this.tezosSupport,
this.tzproApiKey,
this.tzproRpcNode,
});

factory BlockchainOptions.fromJson(Map<String, dynamic> json) =>
_$BlockchainOptionsFromJson(json);

final bool? bnbSupport;
final bool? ethereumSupport;
final bool? fantomSupport;
final bool? hederaSupport;
final String? infuraApiKey;
final bool? infuraRpcNode;
final bool? polygonSupport;
final bool? tezosSupport;
final String? tzproApiKey;
final bool? tzproRpcNode;

Map<String, dynamic> toJson() => _$BlockchainOptionsToJson(this);

@override
List<Object?> get props => [
bnbSupport,
ethereumSupport,
fantomSupport,
hederaSupport,
infuraApiKey,
infuraRpcNode,
polygonSupport,
tezosSupport,
tzproApiKey,
tzproRpcNode,
];
}

@JsonSerializable()
class GeneralOptions extends Equatable {
const GeneralOptions({
this.companyLogo,
this.companyName,
this.companyWebsite,
this.customerPlan,
this.profileName,
this.profileVersion,
this.walletType,
});

factory GeneralOptions.fromJson(Map<String, dynamic> json) =>
_$GeneralOptionsFromJson(json);

final String? companyLogo;
final String? companyName;
final String? companyWebsite;
final String? customerPlan;
final String? profileName;
final String? profileVersion;
final String? walletType;

Map<String, dynamic> toJson() => _$GeneralOptionsToJson(this);

@override
List<Object?> get props => [
companyLogo,
companyName,
companyWebsite,
customerPlan,
profileName,
profileVersion,
walletType,
];
}

@JsonSerializable()
class HelpCenterOptions extends Equatable {
const HelpCenterOptions({
this.customChatSupport,
this.customChatSupportName,
this.customEmail,
this.customEmailSupport,
this.displayChatSupport,
this.displayEmailSupport,
});

factory HelpCenterOptions.fromJson(Map<String, dynamic> json) =>
_$HelpCenterOptionsFromJson(json);

final bool? customChatSupport;
final String? customChatSupportName;
final String? customEmail;
final bool? customEmailSupport;
final bool? displayChatSupport;
final bool? displayEmailSupport;

Map<String, dynamic> toJson() => _$HelpCenterOptionsToJson(this);

@override
List<Object?> get props => [
customChatSupport,
customChatSupportName,
customEmail,
customEmailSupport,
displayChatSupport,
displayEmailSupport,
];
}

@JsonSerializable()
class SelfSovereignIdentityOptions extends Equatable {
const SelfSovereignIdentityOptions({
this.customOidc4VcProfile,
this.displayManageDecentralizedId,
this.displaySsiAdvancedSettings,
this.displayVerifiableDataRegistry,
this.oidv4VcProfile,
});

factory SelfSovereignIdentityOptions.fromJson(Map<String, dynamic> json) =>
_$SelfSovereignIdentityOptionsFromJson(json);

final CustomOidc4VcProfile? customOidc4VcProfile;
final bool? displayManageDecentralizedId;
final bool? displaySsiAdvancedSettings;
final bool? displayVerifiableDataRegistry;
final String? oidv4VcProfile;

Map<String, dynamic> toJson() => _$SelfSovereignIdentityOptionsToJson(this);

@override
List<Object?> get props => [
customOidc4VcProfile,
displayManageDecentralizedId,
displaySsiAdvancedSettings,
displayVerifiableDataRegistry,
oidv4VcProfile,
];
}

@JsonSerializable()
class CustomOidc4VcProfile extends Equatable {
const CustomOidc4VcProfile({
this.clientAuthentication,
this.clientId,
this.clientSecret,
this.cryptoHolderBinding,
this.defaultDid,
this.oidc4VciDraft,
this.oidc4VpDraft,
this.scope,
this.securityLevel,
this.siopv2Draft,
this.subjectSyntaxeType,
this.userPinDigits,
});

factory CustomOidc4VcProfile.fromJson(Map<String, dynamic> json) =>
_$CustomOidc4VcProfileFromJson(json);

final String? clientAuthentication;
final String? clientId;
final String? clientSecret;
final bool? cryptoHolderBinding;
final String? defaultDid;
final String? oidc4VciDraft;
final String? oidc4VpDraft;
final bool? scope;
final String? securityLevel;
final String? siopv2Draft;
final String? subjectSyntaxeType;
final String? userPinDigits;

Map<String, dynamic> toJson() => _$CustomOidc4VcProfileToJson(this);

@override
List<Object?> get props => [
clientAuthentication,
clientId,
clientSecret,
cryptoHolderBinding,
defaultDid,
oidc4VciDraft,
oidc4VpDraft,
scope,
securityLevel,
siopv2Draft,
subjectSyntaxeType,
userPinDigits,
];
}

@JsonSerializable()
class SettingsMenu extends Equatable {
const SettingsMenu({
this.displayDeveloperMode,
this.displayHelpCenter,
this.displayProfile,
});

factory SettingsMenu.fromJson(Map<String, dynamic> json) =>
_$SettingsMenuFromJson(json);

final bool? displayDeveloperMode;
final bool? displayHelpCenter;
final bool? displayProfile;

Map<String, dynamic> toJson() => _$SettingsMenuToJson(this);

@override
List<Object?> get props => [
displayDeveloperMode,
displayHelpCenter,
displayProfile,
];
}

@JsonSerializable()
class WalletSecurityOptions extends Equatable {
const WalletSecurityOptions({
this.confirmSecurityVerifierAccess,
this.displaySecurityAdvancedSettings,
this.secureSecurityAuthenticationWithPinCode,
this.verifySecurityIssuerWebsiteIdentity,
});

factory WalletSecurityOptions.fromJson(Map<String, dynamic> json) =>
_$WalletSecurityOptionsFromJson(json);

final bool? confirmSecurityVerifierAccess;
final bool? displaySecurityAdvancedSettings;
final bool? secureSecurityAuthenticationWithPinCode;
final bool? verifySecurityIssuerWebsiteIdentity;

Map<String, dynamic> toJson() => _$WalletSecurityOptionsToJson(this);

@override
List<Object?> get props => [
confirmSecurityVerifierAccess,
displaySecurityAdvancedSettings,
secureSecurityAuthenticationWithPinCode,
verifySecurityIssuerWebsiteIdentity,
];
}
1 change: 1 addition & 0 deletions lib/app/shared/models/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export 'blockchain_network/ethereum_network.dart';
export 'blockchain_network/fantom_network.dart';
export 'blockchain_network/polygon_network.dart';
export 'blockchain_network/tezos_network.dart';
export 'enterprise_option/enterprise_option.dart';
export 'state_message/state_message.dart';
export 'translation/translation.dart';
export 'xtz_data/xtz_data.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Oidc4vcSettingMenuView extends StatelessWidget {
const DidKeyTypeWidget(),
const DraftTypeWidget(),
const SubjectSyntaxTypeWidget(),
const CredentialManifestSupportWidget(),
const CryptographicHolderBindingWidget(),
const ScopeParameterWidget(),
const ClientAuthenticationWidget(),
Expand Down
Loading

0 comments on commit e94bf1f

Please sign in to comment.