Skip to content

Commit

Permalink
feat: Naming convention update #2616
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Apr 23, 2024
1 parent 3ecff0d commit e7a7599
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ Future<(String?, String?, String?, String?)> getClientDetails({
did: '', // just added as it is required field
mediaType: MediaType.basic, // just added as it is required field
clientType:
ClientType.jwkThumbprint, // just added as it is required field
ClientType.p256JWKThumprint, // just added as it is required field
proofHeaderType: customOidc4vcProfile.proofHeader,
clientId: '', // just added as it is required field
);
Expand All @@ -1619,7 +1619,7 @@ Future<(String?, String?, String?, String?)> getClientDetails({
.replaceAll('=', '');

switch (customOidc4vcProfile.clientType) {
case ClientType.jwkThumbprint:
case ClientType.p256JWKThumprint:
clientId = tokenParameters.thumbprint;
case ClientType.did:
clientId = did;
Expand All @@ -1630,7 +1630,7 @@ Future<(String?, String?, String?, String?)> getClientDetails({
/// only clientId
case ClientAuthentication.clientId:
switch (customOidc4vcProfile.clientType) {
case ClientType.jwkThumbprint:
case ClientType.p256JWKThumprint:
clientId = tokenParameters.thumbprint;
case ClientType.did:
clientId = did;
Expand Down
2 changes: 1 addition & 1 deletion lib/chat_room/cubit/chat_room_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ abstract class ChatRoomCubit extends Cubit<ChatRoomState> {
did: '', // just added as it is required field
mediaType: MediaType.basic, // just added as it is required field
clientType:
ClientType.jwkThumbprint, // just added as it is required field
ClientType.p256JWKThumprint, // just added as it is required field
proofHeaderType: customOidc4vcProfile.proofHeader,
clientId: customOidc4vcProfile.clientId ?? '',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class _SelectiveDisclosurePickViewState
did: '', // just added as it is required field
mediaType: MediaType.selectiveDisclosure,
clientType:
ClientType.jwkThumbprint, // just added as it is required field
ClientType.p256JWKThumprint, // just added as it is required field
proofHeaderType: customOidc4vcProfile.proofHeader,
clientId: '', // just added as it is required field
);
Expand Down
2 changes: 1 addition & 1 deletion lib/scan/cubit/scan_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ class ScanCubit extends Cubit<ScanState> {
did: '', // just added as it is required field
mediaType: MediaType.basic, // just added as it is required field
clientType:
ClientType.jwkThumbprint, // just added as it is required field
ClientType.p256JWKThumprint, // just added as it is required field
proofHeaderType: customOidc4vcProfile.proofHeader,
clientId: '', // just added as it is required field
);
Expand Down
4 changes: 2 additions & 2 deletions packages/oidc4vc/lib/src/client_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';

enum ClientType {
@JsonValue('urn:ietf:params:oauth:jwk-thumbprint')
jwkThumbprint,
p256JWKThumprint,

did,

Expand All @@ -12,7 +12,7 @@ enum ClientType {
extension ClientTypeX on ClientType {
String get getTitle {
switch (this) {
case ClientType.jwkThumbprint:
case ClientType.p256JWKThumprint:
return 'P-256 JWK Thumbprint';
case ClientType.did:
return 'DID';
Expand Down
4 changes: 2 additions & 2 deletions packages/oidc4vc/lib/src/oidc4vc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ class OIDC4VC {
var issAndSub = tokenParameters.thumbprint;

switch (tokenParameters.clientType) {
case ClientType.jwkThumbprint:
case ClientType.p256JWKThumprint:
issAndSub = tokenParameters.thumbprint;
case ClientType.did:
issAndSub = tokenParameters.did;
Expand All @@ -1540,7 +1540,7 @@ class OIDC4VC {
payload['nonce'] = tokenParameters.nonce!;
}

if (tokenParameters.clientType == ClientType.jwkThumbprint) {
if (tokenParameters.clientType == ClientType.p256JWKThumprint) {
payload['sub_jwk'] = tokenParameters.publicJWK;
}

Expand Down

0 comments on commit e7a7599

Please sign in to comment.