Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Feature/#263 add SocketAuthenicator and JWT #283

Merged
merged 54 commits into from
Jun 24, 2022

Conversation

llbartekll
Copy link
Contributor

@llbartekll llbartekll commented Jun 23, 2022

Adds SocketAuthenicator, JWT, JWT signer for client authentication on Iridium with unit tests for dependant components.
close #284
close #285
close #286
close #287

fix codec tests
…V2 into #273-encryption-policies

# Conflicts:
#	Sources/Chat/NetworkingInteractor.swift
#	Sources/Chat/Serializing.swift
#	Sources/WalletConnectKMS/Codec/ChaChaPolyCodec.swift
#	Sources/WalletConnectKMS/Crypto/CryptoKitWrapper/CryptoKitWrapper.swift
#	Sources/WalletConnectKMS/Crypto/KeyManagementService.swift
#	Sources/WalletConnectKMS/Serialiser/Serializer.swift
#	Sources/WalletConnectSign/NetworkInteractor/NetworkInteractor.swift
#	Sources/WalletConnectSign/Serializing.swift
#	Tests/IntegrationTests/SerialiserTests.swift
#	Tests/TestingUtils/Mocks/KeyManagementServiceMock.swift
#	Tests/WalletConnectSignTests/Mocks/SerializerMock.swift
@llbartekll llbartekll marked this pull request as ready for review June 23, 2022 09:16
@llbartekll llbartekll marked this pull request as draft June 23, 2022 11:36
@llbartekll llbartekll changed the title #263 add client [Core] Feature/#263 add SocketAuthenicator and JWT Jun 23, 2022
@llbartekll llbartekll marked this pull request as ready for review June 23, 2022 12:56
@@ -0,0 +1,30 @@
import Foundation

struct JWT: Codable, Equatable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be split to JWT and SignedJWT ?

public func sign(jwt: JWT, using jwtSigner: JWTSigning) throws -> SignedJWT

or something like that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, no need to modify alg inside Header. We could just recreate Header

enum Errors: Error {
case invalidJWTString
}
var alg = "EdDSA"
Copy link
Contributor

@flypaper0 flypaper0 Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why alg everywhere is internal var?

var sut: ED25519DIDKeyFactoryImpl!

func test() {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

planning to implement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implemented but the factory itself is not implemented - scope of #288

@llbartekll llbartekll merged commit b932692 into develop Jun 24, 2022
@llbartekll llbartekll deleted the #263-Add-client-id branch June 24, 2022 10:11
@flypaper0 flypaper0 mentioned this pull request Jul 5, 2022
llbartekll added a commit that referenced this pull request Jul 5, 2022
* Add SerializationPolicy type

* savepoint

* savepoint

* Add envelope

* update serialize method

* update envelope

* handle envelope in Sign sdk

* extract envelope to a new file

* add getPublicKey method to kms

* fix kms errors

* fix kms tests

* add kms tests scheme
fix codec tests

* fix serializer tests

* update kms test, fix type 0 envelope key size issue

* simplify serialiser, add envelope init

* Fix envelope type, fix serialiser tests

* remove debugging prints

* update codec docs

* remove unused error

* remove unused error

* move serializing protocol to serializer

* prevent potential crash on envelope init

* add serializing file

* run lint

* Add client auth core components

* Add client auth mocks

* Add signing private key

* Add signing crypto kit wrapper

* Add Socket Authenticator Test

* update SocketAuthenticator

* savepoint

* savepoint

* pass jwt test

* extract jwt encoder

* savepoint

* update signer

* fix tests

* extract ED25519DIDKeyFactoryMock

* clean up

* remove commented code

* run lint fix

* change relay url

* test

* update relay url

* test

* test

* revert

* test

* fix typo

* savepoint

* Update ED25519DIDKeyFactoryTests

* update test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants