Skip to content

Commit

Permalink
Fix #8: Delete subfolder eudi-wallet-oidc-ios and rename to use Camel…
Browse files Browse the repository at this point in the history
…Case
  • Loading branch information
Mumthasir-vp authored and georgepadayatti committed May 10, 2024
1 parent 9e0b425 commit 7bd2bda
Show file tree
Hide file tree
Showing 35 changed files with 45 additions and 69 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,26 @@
import PackageDescription

let package = Package(
name: "eudi-wallet-oidc-ios",
name: "eudiWalletOidcIos",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "eudi-wallet-oidc-ios",
targets: ["eudi-wallet-oidc-ios"]),
name: "eudiWalletOidcIos",
targets: ["eudiWalletOidcIos"]),
],
dependencies: [
.package(url: "https://github.com/keefertaylor/Base58Swift.git", branch: "master"),
.package(name: "KeychainSwift", url: "https://github.com/evgenyneu/keychain-swift.git", from: "21.0.0"),
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.8.1"),
.package(url: "https://github.com/decentralised-dataexchange/PresentationExchangeSdkiOS.git", .upToNextMajor(from: "2024.3.1"))
],
targets: [
.target(
name: "eudi-wallet-oidc-ios",
dependencies: ["Base58Swift", "KeychainSwift", "CryptoSwift", "PresentationExchangeSdkiOS"],
path: "Sources"),
name: "eudiWalletOidcIos",
dependencies: ["Base58Swift", "CryptoSwift", "PresentationExchangeSdkiOS"]),
.testTarget(
name: "eudi-wallet-oidc-iosTests",
dependencies: ["eudi-wallet-oidc-ios"]),
dependencies: ["eudiWalletOidcIos"]),
]
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import Foundation
import CryptoKit
import KeychainSwift
//import KeychainSwift
import CryptoSwift

public class IssueService {

static var shared = IssueService()
public static var shared = IssueService()
private init() {}

// MARK: - Retrieves credential issuer asynchronously based on the provided credential_offer / credential_offer_uri.
Expand Down
30 changes: 30 additions & 0 deletions Tests/eudi-wallet-oidc-iosTests/eudi_wallet_oidc_iosTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import XCTest
@testable import eudi_wallet_oidc_ios

final class eudi_wallet_oidc_iosTests: XCTestCase {
func testRecieveAndStoreCredential() async throws {
// XCTest Documentation
// https://developer.apple.com/documentation/xctest

// Defining Test Cases and Test Methods
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods

// MARK: Resolve credential offer (EWC RFC 001 - 3.1, 3.2)
// Credential offer is one time usable, please ensure it is replaced before running this test
// FIXME: Throw error if credential offer is not resolved
var inTimeCredentialOffer = "openid-credential-offer://?credential_offer_uri=https://oid4vc.igrant.io/organisation/a6b946b8-06a3-445f-8b75-ec0e7b17a040/service/credential-offer/eb0aa2d6-e9f0-4af9-840b-95b468cd7870"
var resolvedCredentialOffer = try await IssueService.shared.resolveCredentialOffer(credentialOfferString: inTimeCredentialOffer)
XCTAssertEqual(resolvedCredentialOffer?.grants?.authCode?.preAuthorizedCode, nil)
XCTAssertNotEqual(resolvedCredentialOffer?.grants?.authorizationCode?.issuerState, nil)

// MARK: Discovery (EWC RFC 001 - 3.3, 3.4)
var issuerConfig = try? await DiscoveryService.shared.getIssuerConfig(credentialIssuerWellKnownURI: resolvedCredentialOffer?.credentialIssuer)
var authConfig = try? await DiscoveryService.shared.getAuthConfig(authorisationServerWellKnownURI: issuerConfig?.authorizationServer ?? issuerConfig?.credentialIssuer)
// debugPrint(issuerConfig)
// debugPrint(authConfig)

XCTAssertNotNil(authConfig?.authorizationEndpoint)
}


}
8 changes: 0 additions & 8 deletions eudi-wallet-oidc-ios/.gitignore

This file was deleted.

This file was deleted.

31 changes: 0 additions & 31 deletions eudi-wallet-oidc-ios/Package.swift

This file was deleted.

This file was deleted.

0 comments on commit 7bd2bda

Please sign in to comment.