-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pollux): add anoncreds issuance
As didcomm swift repo has changed this also updates the breaking changes
- Loading branch information
1 parent
dfe4697
commit 8882142
Showing
39 changed files
with
817 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
AtalaPrismSDK/Apollo/Sources/Operations/CreateLinkSecretOperation.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import AnoncredsSwift | ||
import Foundation | ||
|
||
struct CreateLinkSecretOperation { | ||
func create() -> String { | ||
Prover().createLinkSecret().getBigNumber() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
AtalaPrismSDK/Pluto/Sources/Domain/Providers/LinkSecretProvider.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Combine | ||
import Foundation | ||
|
||
protocol LinkSecretProvider { | ||
func getAll() -> AnyPublisher<[String], Error> | ||
} |
6 changes: 6 additions & 0 deletions
6
AtalaPrismSDK/Pluto/Sources/Domain/Stores/LinkSecretStore.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Combine | ||
import Foundation | ||
|
||
protocol LinkSecretStore { | ||
func addLinkSecret(_ linkSecret: String) -> AnyPublisher<Void, Error> | ||
} |
16 changes: 16 additions & 0 deletions
16
AtalaPrismSDK/Pluto/Sources/PersistentStorage/DAO/CDLinkSecretDAO+LinkSecretProvider.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Goncalo Frade IOHK on 22/08/2023. | ||
// | ||
import Combine | ||
import Foundation | ||
|
||
extension CDLinkSecretDAO: LinkSecretProvider { | ||
func getAll() -> AnyPublisher<[String], Error> { | ||
fetchController(context: readContext) | ||
.map { $0.map(\.secret) } | ||
.eraseToAnyPublisher() | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
AtalaPrismSDK/Pluto/Sources/PersistentStorage/DAO/CDLinkSecretDAO+LinkSecretStore.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Combine | ||
import CoreData | ||
import Domain | ||
|
||
extension CDLinkSecretDAO: LinkSecretStore { | ||
func addLinkSecret(_ linkSecret: String) -> AnyPublisher<Void, Error> { | ||
updateOrCreate(linkSecret, context: writeContext) { cdobj, context in | ||
cdobj.secret = linkSecret | ||
} | ||
.map { _ in } | ||
.eraseToAnyPublisher() | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
AtalaPrismSDK/Pluto/Sources/PersistentStorage/DAO/CDLinkSecretDAO.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Combine | ||
import CoreData | ||
|
||
struct CDLinkSecretDAO: CoreDataDAO { | ||
typealias CoreDataObject = CDLinkSecret | ||
let readContext: NSManagedObjectContext | ||
let writeContext: NSManagedObjectContext | ||
let identifierKey: String? = "secret" | ||
} |
5 changes: 5 additions & 0 deletions
5
AtalaPrismSDK/Pluto/Sources/PersistentStorage/Models/CDLinkSecret+CoreDataClass.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import CoreData | ||
import Foundation | ||
|
||
@objc(CDLinkSecret) | ||
class CDLinkSecret: NSManagedObject {} |
14 changes: 14 additions & 0 deletions
14
AtalaPrismSDK/Pluto/Sources/PersistentStorage/Models/CDLinkSecret+CoreDataProperties.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import CoreData | ||
import Foundation | ||
|
||
extension CDLinkSecret { | ||
@nonobjc class func fetchRequest() -> NSFetchRequest<CDLinkSecret> { | ||
return NSFetchRequest<CDLinkSecret>(entityName: "CDLinkSecret") | ||
} | ||
|
||
@NSManaged var secret: String | ||
} | ||
|
||
extension CDLinkSecret: Identifiable { | ||
var id: String { secret } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
AtalaPrismSDK/Pollux/Sources/Models/AnonCreds/AnonCredential+ProvableCredential.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Domain | ||
import Foundation |
49 changes: 49 additions & 0 deletions
49
AtalaPrismSDK/Pollux/Sources/Models/AnonCreds/AnonCredential+StorableCredential.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Domain | ||
import Foundation | ||
|
||
extension AnonCredential: StorableCredential { | ||
var storingId: String { | ||
id | ||
} | ||
|
||
var recoveryId: String { | ||
"anon+credential" | ||
} | ||
|
||
var credentialData: Data { | ||
(try? JSONEncoder().encode(self)) ?? Data() | ||
} | ||
|
||
var queryIssuer: String? { | ||
issuer | ||
} | ||
|
||
var querySubject: String? { | ||
subject | ||
} | ||
|
||
var queryCredentialCreated: Date? { | ||
nil | ||
} | ||
|
||
var queryCredentialUpdated: Date? { | ||
nil | ||
} | ||
|
||
var queryCredentialSchema: String? { | ||
schemaId | ||
} | ||
|
||
var queryValidUntil: Date? { | ||
nil | ||
} | ||
|
||
var queryRevoked: Bool? { | ||
nil | ||
// revocationRegistryId != nil | ||
} | ||
|
||
var queryAvailableClaims: [String] { | ||
claims.map(\.key) | ||
} | ||
} |
Oops, something went wrong.