Skip to content

Commit

Permalink
Merge pull request #140 from velocitycareerlabs/VL-8490
Browse files Browse the repository at this point in the history
VL-8490 - v2.6.9 support primary-source checks using @context
  • Loading branch information
michaelavoyan authored Dec 1, 2024
2 parents 560f0d9 + 6de8f26 commit 54da171
Show file tree
Hide file tree
Showing 181 changed files with 630 additions and 603 deletions.
24 changes: 8 additions & 16 deletions VCL/VCL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
28D3F8CE2A641842001CF3C2 /* CredentialDidVerifierImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D3F8CD2A641842001CF3C2 /* CredentialDidVerifierImpl.swift */; };
28D3F8D02A642AB5001CF3C2 /* CredentialIssuerVerifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D3F8CF2A642AB5001CF3C2 /* CredentialIssuerVerifier.swift */; };
28D3F8D22A642B29001CF3C2 /* CredentialIssuerVerifierImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D3F8D12A642B29001CF3C2 /* CredentialIssuerVerifierImpl.swift */; };
28D3F8D82A643513001CF3C2 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D3F8D72A643513001CF3C2 /* Utils.swift */; };
28D3F8D82A643513001CF3C2 /* VerificationUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D3F8D72A643513001CF3C2 /* VerificationUtils.swift */; };
28D4D6182A0CEDD500059A87 /* VCLKeyServiceLocalImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D4D6172A0CEDD500059A87 /* VCLKeyServiceLocalImpl.swift */; };
28D4D61B2A0CEDFC00059A87 /* VCLKeyService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D4D61A2A0CEDFC00059A87 /* VCLKeyService.swift */; };
28DB58C22BB458AE00DD9553 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 28DB58C12BB458AE00DD9553 /* PrivacyInfo.xcprivacy */; };
Expand Down Expand Up @@ -575,7 +575,7 @@
28D3F8CD2A641842001CF3C2 /* CredentialDidVerifierImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialDidVerifierImpl.swift; sourceTree = "<group>"; };
28D3F8CF2A642AB5001CF3C2 /* CredentialIssuerVerifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialIssuerVerifier.swift; sourceTree = "<group>"; };
28D3F8D12A642B29001CF3C2 /* CredentialIssuerVerifierImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialIssuerVerifierImpl.swift; sourceTree = "<group>"; };
28D3F8D72A643513001CF3C2 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
28D3F8D72A643513001CF3C2 /* VerificationUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerificationUtils.swift; sourceTree = "<group>"; };
28D4D6172A0CEDD500059A87 /* VCLKeyServiceLocalImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCLKeyServiceLocalImpl.swift; sourceTree = "<group>"; };
28D4D61A2A0CEDFC00059A87 /* VCLKeyService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCLKeyService.swift; sourceTree = "<group>"; };
28DB58C12BB458AE00DD9553 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
Expand Down Expand Up @@ -721,7 +721,6 @@
28641546264D65E2006C1AA3 /* models */,
28641538264D65E2006C1AA3 /* repositories */,
28641556264D65E2006C1AA3 /* usecases */,
28D3F8C02A64178B001CF3C2 /* utils */,
28A6FAA92B28DF9B00C7675E /* verifiers */,
);
path = data;
Expand Down Expand Up @@ -1234,6 +1233,7 @@
28A6FAB42B28E09C00C7675E /* CredentialsByDeepLinkVerifierImpl.swift */,
28A6FAB32B28E09B00C7675E /* OffersByDeepLinkVerifierImpl.swift */,
28A6FAB52B28E09C00C7675E /* PresentationRequestByDeepLinkVerifierImpl.swift */,
28D3F8D72A643513001CF3C2 /* VerificationUtils.swift */,
);
path = verifiers;
sourceTree = "<group>";
Expand Down Expand Up @@ -1273,14 +1273,6 @@
path = valid;
sourceTree = "<group>";
};
28D3F8C02A64178B001CF3C2 /* utils */ = {
isa = PBXGroup;
children = (
28D3F8D72A643513001CF3C2 /* Utils.swift */,
);
path = utils;
sourceTree = "<group>";
};
28D3F8CA2A6417A7001CF3C2 /* verifiers */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1619,7 +1611,7 @@
28648A642AA8736D002FD0E2 /* VCLInjectedCryptoServicesDescriptor.swift in Sources */,
281EDC30295AE46200D2D381 /* VCLJwtDescriptor.swift in Sources */,
286415FC264D65E2006C1AA3 /* VCLPublicJwk.swift in Sources */,
28D3F8D82A643513001CF3C2 /* Utils.swift in Sources */,
28D3F8D82A643513001CF3C2 /* VerificationUtils.swift in Sources */,
28600695274A81540018AC8F /* VCLOffers.swift in Sources */,
28C7585B26C1798500269A09 /* VCLSubmissionResult.swift in Sources */,
28FA80E826789D25000A3C7F /* JwtServiceUseCaseImpl.swift in Sources */,
Expand Down Expand Up @@ -1908,7 +1900,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 152;
CURRENT_PROJECT_VERSION = 153;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 7DDDGP43MJ;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -1921,7 +1913,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.6.8;
MARKETING_VERSION = 2.6.9;
PRODUCT_BUNDLE_IDENTIFIER = io.velocitycareerlabs.VCL;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1938,7 +1930,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 152;
CURRENT_PROJECT_VERSION = 153;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 7DDDGP43MJ;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -1951,7 +1943,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.6.8;
MARKETING_VERSION = 2.6.9;
PRODUCT_BUNDLE_IDENTIFIER = io.velocitycareerlabs.VCL;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
90 changes: 45 additions & 45 deletions VCL/VCL/api/VCL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
// Copyright 2022 Velocity Career Labs inc.
// SPDX-License-Identifier: Apache-2.0

public protocol VCL: Sendable {
public protocol VCL {

func initialize(
initializationDescriptor: VCLInitializationDescriptor,
successHandler: @escaping @Sendable () -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping () -> Void,
errorHandler: @escaping (VCLError) -> Void
)

var countries: VCLCountries? { get }
Expand All @@ -21,94 +21,94 @@ public protocol VCL: Sendable {

func getPresentationRequest(
presentationRequestDescriptor: VCLPresentationRequestDescriptor,
successHandler: @escaping @Sendable (VCLPresentationRequest) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLPresentationRequest) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func submitPresentation(
presentationSubmission: VCLPresentationSubmission,
successHandler: @escaping @Sendable (VCLSubmissionResult) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLSubmissionResult) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func getExchangeProgress(
exchangeDescriptor: VCLExchangeDescriptor,
successHandler: @escaping @Sendable (VCLExchange) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLExchange) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func searchForOrganizations(
organizationsSearchDescriptor: VCLOrganizationsSearchDescriptor,
successHandler: @escaping @Sendable (VCLOrganizations) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLOrganizations) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func getCredentialManifest(
credentialManifestDescriptor: VCLCredentialManifestDescriptor,
successHandler: @escaping @Sendable (VCLCredentialManifest) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLCredentialManifest) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func generateOffers(
generateOffersDescriptor: VCLGenerateOffersDescriptor,
successHandler: @escaping @Sendable (VCLOffers) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLOffers) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func checkForOffers(
generateOffersDescriptor: VCLGenerateOffersDescriptor,
sessionToken: VCLToken,
successHandler: @escaping @Sendable (VCLOffers) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLOffers) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func finalizeOffers(
finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,
sessionToken: VCLToken,
successHandler: @escaping @Sendable (VCLJwtVerifiableCredentials) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLJwtVerifiableCredentials) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func getCredentialTypesUIFormSchema(
credentialTypesUIFormSchemaDescriptor: VCLCredentialTypesUIFormSchemaDescriptor,
successHandler: @escaping @Sendable (VCLCredentialTypesUIFormSchema) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLCredentialTypesUIFormSchema) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func getVerifiedProfile(
verifiedProfileDescriptor: VCLVerifiedProfileDescriptor,
successHandler: @escaping @Sendable (VCLVerifiedProfile) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLVerifiedProfile) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func verifyJwt(
jwt: VCLJwt,
publicJwk: VCLPublicJwk,
remoteCryptoServicesToken: VCLToken?,
successHandler: @escaping @Sendable (Bool) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (Bool) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func generateSignedJwt(
jwtDescriptor: VCLJwtDescriptor,
didJwk: VCLDidJwk,
remoteCryptoServicesToken: VCLToken?,
successHandler: @escaping @Sendable (VCLJwt) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLJwt) -> Void,
errorHandler: @escaping (VCLError) -> Void
)

func generateDidJwk(
didJwkDescriptor: VCLDidJwkDescriptor,
successHandler: @escaping @Sendable (VCLDidJwk) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLDidJwk) -> Void,
errorHandler: @escaping (VCLError) -> Void
)
}

extension VCL {
public func getPresentationRequest(
presentationRequestDescriptor: VCLPresentationRequestDescriptor,
successHandler: @escaping @Sendable (VCLPresentationRequest) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLPresentationRequest) -> Void,
errorHandler: @escaping (VCLError) -> Void
) {
getPresentationRequest(
presentationRequestDescriptor: presentationRequestDescriptor,
Expand All @@ -119,8 +119,8 @@ extension VCL {

public func submitPresentation(
presentationSubmission: VCLPresentationSubmission,
successHandler: @escaping @Sendable (VCLSubmissionResult) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLSubmissionResult) -> Void,
errorHandler: @escaping (VCLError) -> Void
) {
submitPresentation(
presentationSubmission: presentationSubmission,
Expand All @@ -131,8 +131,8 @@ extension VCL {

public func getCredentialManifest(
credentialManifestDescriptor: VCLCredentialManifestDescriptor,
successHandler: @escaping @Sendable (VCLCredentialManifest) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLCredentialManifest) -> Void,
errorHandler: @escaping (VCLError) -> Void
) {
getCredentialManifest(
credentialManifestDescriptor: credentialManifestDescriptor,
Expand All @@ -143,8 +143,8 @@ extension VCL {

public func generateOffers(
generateOffersDescriptor: VCLGenerateOffersDescriptor,
successHandler: @escaping @Sendable (VCLOffers) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLOffers) -> Void,
errorHandler: @escaping (VCLError) -> Void
) {
generateOffers(
generateOffersDescriptor: generateOffersDescriptor,
Expand All @@ -156,8 +156,8 @@ extension VCL {
public func finalizeOffers(
finalizeOffersDescriptor: VCLFinalizeOffersDescriptor,
sessionToken: VCLToken,
successHandler: @escaping @Sendable (VCLJwtVerifiableCredentials) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLJwtVerifiableCredentials) -> Void,
errorHandler: @escaping (VCLError) -> Void
) {
finalizeOffers(
finalizeOffersDescriptor: finalizeOffersDescriptor,
Expand All @@ -171,8 +171,8 @@ extension VCL {
jwt: VCLJwt,
publicJwk: VCLPublicJwk,
remoteCryptoServicesToken: VCLToken? = nil,
successHandler: @escaping @Sendable (Bool) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (Bool) -> Void,
errorHandler: @escaping (VCLError) -> Void
) {
verifyJwt(
jwt: jwt,
Expand All @@ -187,8 +187,8 @@ extension VCL {
didJwk: VCLDidJwk,
jwtDescriptor: VCLJwtDescriptor,
remoteCryptoServicesToken: VCLToken? = nil,
successHandler: @escaping @Sendable (VCLJwt) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLJwt) -> Void,
errorHandler: @escaping (VCLError) -> Void
) {
generateSignedJwt(
jwtDescriptor: jwtDescriptor,
Expand All @@ -201,8 +201,8 @@ extension VCL {

public func generateDidJwk(
didJwkDescriptor: VCLDidJwkDescriptor = VCLDidJwkDescriptor(),
successHandler: @escaping @Sendable (VCLDidJwk) -> Void,
errorHandler: @escaping @Sendable (VCLError) -> Void
successHandler: @escaping (VCLDidJwk) -> Void,
errorHandler: @escaping (VCLError) -> Void
) {
generateDidJwk(
didJwkDescriptor: didJwkDescriptor,
Expand Down
2 changes: 1 addition & 1 deletion VCL/VCL/api/VCLCryptoServiceType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import Foundation

public enum VCLCryptoServiceType: String, Sendable {
public enum VCLCryptoServiceType: String {
case Local = "local"
case Remote = "remote"
case Injected = "injected"
Expand Down
2 changes: 1 addition & 1 deletion VCL/VCL/api/VCLEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import Foundation

public enum VCLEnvironment: String, Sendable {
public enum VCLEnvironment: String {
case Prod = "prod"
case Staging = "staging"
case Qa = "qa"
Expand Down
2 changes: 1 addition & 1 deletion VCL/VCL/api/VCLProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Copyright 2022 Velocity Career Labs inc.
// SPDX-License-Identifier: Apache-2.0

public final class VCLProvider: Sendable {
public final class VCLProvider {

private init(){}

Expand Down
2 changes: 1 addition & 1 deletion VCL/VCL/api/VCLSignatureAlgorithm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import Foundation

public enum VCLSignatureAlgorithm: String, Sendable {
public enum VCLSignatureAlgorithm: String {
case ES256 = "P-256"
case SECP256k1 = "secp256k1"

Expand Down
2 changes: 1 addition & 1 deletion VCL/VCL/api/VCLXVnfProtocolVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import Foundation

public enum VCLXVnfProtocolVersion: String, Sendable {
public enum VCLXVnfProtocolVersion: String {
case XVnfProtocolVersion1 = "1.0"
case XVnfProtocolVersion2 = "2.0"

Expand Down
8 changes: 4 additions & 4 deletions VCL/VCL/api/entities/VCLClaims.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
import Foundation
import VCToken

public struct VCLClaims: Sendable, Claims, Decodable, Encodable {
public struct VCLClaims: Claims, Decodable, Encodable {

public let all: [String: Sendable]
public let all: [String: Any]

public init(from decoder: Decoder) throws {
self.all = [String : Sendable]()
self.all = [String : Any]()
// VCLLog.d("Dummy implementation")
}

public func encode(to encoder: Encoder) throws {
// VCLLog.d("Empty implementation")
}

public init(all: [String : Sendable]) {
public init(all: [String : Any]) {
self.all = all
}

Expand Down
2 changes: 1 addition & 1 deletion VCL/VCL/api/entities/VCLCountries.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import Foundation

public struct VCLCountries: Sendable {
public struct VCLCountries {
public let all: [VCLCountry]?

public init(all: [VCLCountry]?) {
Expand Down
Loading

0 comments on commit 54da171

Please sign in to comment.