Skip to content

Commit

Permalink
[INJIMOB-812]: refactor class and module name (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: adityankannan-tw <[email protected]>
Co-authored-by: adityankannan-tw <[email protected]>
  • Loading branch information
adityankannan-tw and Adityankannan authored Sep 26, 2024
1 parent f742436 commit 8bff90c
Show file tree
Hide file tree
Showing 32 changed files with 26 additions and 26 deletions.
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
import PackageDescription

let package = Package(
name: "OpenId4VP",
name: "OpenID4VP",
platforms: [
.macOS(.v11),
.iOS(.v13)
],
products: [
.library(
name: "OpenId4VP",
targets: ["OpenId4VP"]),
name: "OpenID4VP",
targets: ["OpenID4VP"]),
],
targets: [
.target(
name: "OpenId4VP"),
name: "OpenID4VP"),
.testTarget(
name: "OpenId4VPTests",
dependencies: ["OpenId4VP"]),
name: "OpenID4VPTests",
dependencies: ["OpenID4VP"]),
]
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ This method will also notify the Verifier about the error by sending it to the r
- Returns Json string back with verifiable presentation created using the credentials received without proof field.

```
let response = try openId4Vp.constructVerifiablePresentation(credentialsMap: [String: [String]])
let response = try openID4VP.constructVerifiablePresentation(credentialsMap: [String: [String]])
```

###### Parameters
Expand All @@ -71,7 +71,7 @@ This method will also notify the Verifier about the error by sending it to the r
- Returns the response with a success message back to the wallet.

```
let response = try await openId4Vp.shareVerifiablePresentation(vpResponseMetadata: VPResponseMetadata)
let response = try await openID4VP.shareVerifiablePresentation(vpResponseMetadata: VPResponseMetadata)
```

###### Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Logger {
}
}
static func getLogTag(className: String) {
logTag = "INJI-OpenID4Vp : \(className) | traceID \(String(describing: self.traceabilityId))"
logTag = "INJI-OpenID4VP : \(className) | traceID \(String(describing: self.traceabilityId))"
}

static func error(_ message: String) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public class OpenId4VP {
public class OpenID4VP {
let traceabilityId: String
let networkManager: NetworkManaging
var authorizationRequest: AuthorizationRequest?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation
@testable import OpenId4VP
@testable import OpenID4VP

class MockNetworkManager: NetworkManaging {
var response: HTTPURLResponse?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation
@testable import OpenId4VP
@testable import OpenID4VP

func createVerifiers(from verifierList: [[String: Any]]) -> [Verifier] {
var verifiers: [Verifier] = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import XCTest
@testable import OpenId4VP
@testable import OpenID4VP

class OpenId4VPTests: XCTestCase {
var openId4Vp: OpenId4VP!
class OpenID4VPTests: XCTestCase {
var openID4VP: OpenID4VP!
var mockNetworkManager: MockNetworkManager!

let authorizationRequest = AuthorizationRequest(
Expand Down Expand Up @@ -31,17 +31,17 @@ class OpenId4VPTests: XCTestCase {
super.setUp()
mockNetworkManager = MockNetworkManager()

openId4Vp = OpenId4VP(traceabilityId: "AXESWSAW123", networkManager: mockNetworkManager)
openId4Vp.setPresentationDefinitionId("AWSE")
openId4Vp.setResponseUri("https://example.com")
openId4Vp.authorizationRequest = authorizationRequest
openID4VP = OpenID4VP(traceabilityId: "AXESWSAW123", networkManager: mockNetworkManager)
openID4VP.setPresentationDefinitionId("AWSE")
openID4VP.setResponseUri("https://example.com")
openID4VP.authorizationRequest = authorizationRequest

AuthorizationResponse.descriptorMap = descriptorMap
AuthorizationResponse.vpTokenForSigning = vpToken
}

override func tearDown() {
openId4Vp = nil
openID4VP = nil
mockNetworkManager = nil
super.tearDown()
}
Expand Down Expand Up @@ -76,7 +76,7 @@ class OpenId4VPTests: XCTestCase {
let decoded: Any?

do {
decoded = try await openId4Vp.authenticateVerifier(encodedAuthorizationRequest: testValidEncodedVpRequest, trustedVerifierJSON: verifiers)
decoded = try await openID4VP.authenticateVerifier(encodedAuthorizationRequest: testValidEncodedVpRequest, trustedVerifierJSON: verifiers)
} catch {
decoded = nil
}
Expand All @@ -88,7 +88,7 @@ class OpenId4VPTests: XCTestCase {
let verifiers = createVerifiers(from: testVerifierList)

let error = await Task {
try await openId4Vp.authenticateVerifier(encodedAuthorizationRequest: testInvalidPresentationDefinitionVpRequest, trustedVerifierJSON: verifiers)
try await openID4VP.authenticateVerifier(encodedAuthorizationRequest: testInvalidPresentationDefinitionVpRequest, trustedVerifierJSON: verifiers)
}.result

switch error {
Expand All @@ -103,7 +103,7 @@ class OpenId4VPTests: XCTestCase {
let verifiers = createVerifiers(from: testVerifierList)

let error = await Task {
try await openId4Vp.authenticateVerifier(encodedAuthorizationRequest: invalidVpRequest, trustedVerifierJSON: verifiers)
try await openID4VP.authenticateVerifier(encodedAuthorizationRequest: invalidVpRequest, trustedVerifierJSON: verifiers)
}.result

switch error {
Expand All @@ -128,7 +128,7 @@ class OpenId4VPTests: XCTestCase {
let received: String?

do {
received = try await openId4Vp.constructVerifiablePresentationToken(credentialsMap: credentialsMap)
received = try await openID4VP.constructVerifiablePresentationToken(credentialsMap: credentialsMap)
}catch{
received = nil
}
Expand All @@ -139,7 +139,7 @@ class OpenId4VPTests: XCTestCase {

let vcResponseMetaData = VPResponseMetadata(jws: jws, signatureAlgorithm: signatureAlgoType, publicKey: publicKey, domain: domain)

let response = try await openId4Vp.shareVerifiablePresentation(vpResponseMetadata: vcResponseMetaData)
let response = try await openID4VP.shareVerifiablePresentation(vpResponseMetadata: vcResponseMetaData)

XCTAssertEqual(response, "Success: Request completed successfully.")
}
Expand All @@ -153,7 +153,7 @@ class OpenId4VPTests: XCTestCase {


do {
let _ = try await openId4Vp.shareVerifiablePresentation(vpResponseMetadata: vcResponseMetaData)
let _ = try await openID4VP.shareVerifiablePresentation(vpResponseMetadata: vcResponseMetaData)
} catch let error as NetworkRequestException {
switch error {
case .networkRequestFailed(let message):
Expand Down

0 comments on commit 8bff90c

Please sign in to comment.