This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from magiclabs/jerryliu-sc-63905-spm-monorepo-i…
…nvestigation iOS MWS
- Loading branch information
Showing
7 changed files
with
106 additions
and
7 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
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,27 @@ | ||
# | ||
# Local Podspec for building local target | ||
# | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'MagicExt-OIDC' | ||
s.version = '1.1.0' | ||
s.summary = 'Magic IOS Extension - OIDC' | ||
|
||
s.description = <<-DESC | ||
TODO: Add long description of the pod here. | ||
DESC | ||
|
||
s.homepage = 'https://github.com/magicLabs/magic-ios-ext' | ||
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
s.author = { 'Jerry Liu' => '[email protected]' } | ||
s.source = { :git => 'https://github.com/magicLabs/magic-ios-ext.git', :tag => s.version.to_s } | ||
s.swift_version = '5.0' | ||
s.ios.deployment_target = '10.0' | ||
# s.osx.deployment_target = '10.12' | ||
|
||
s.source_files = 'Sources/MagicExt-OIDC/**/*' | ||
|
||
s.dependency 'MagicSDK', '~> 4.0' | ||
|
||
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// OIDCExtension.swift | ||
// MagicSDK | ||
// | ||
// Created by Jerry Liu on 10/16/22. | ||
// | ||
|
||
import Foundation | ||
import MagicSDK_Web3 | ||
import MagicSDK | ||
|
||
public class OIDCExtension: BaseModule { | ||
|
||
public func loginWithOIDC (_ configuration: OpenIdConfiguration, response: @escaping Web3ResponseCompletion<String> ) { | ||
let request = RPCRequest<[OpenIdConfiguration]>(method: OIDCMethod.magic_auth_login_with_oidc.rawValue, params: [configuration]) | ||
self.provider.send(request: request, response: response) | ||
} | ||
} | ||
|
||
extension Magic { | ||
public var openid: OIDCExtension { | ||
return OIDCExtension(rpcProvider: self.rpcProvider) | ||
} | ||
} |
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,11 @@ | ||
// | ||
// OIDCMethod.swift | ||
// | ||
// | ||
// Created by Jerry Liu on 10/17/22. | ||
// | ||
|
||
import Foundation | ||
internal enum OIDCMethod: String, CaseIterable { | ||
case magic_auth_login_with_oidc | ||
} |
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,19 @@ | ||
// | ||
// OpenIdConfiguration.swift | ||
// | ||
// | ||
// Created by Jerry Liu on 10/17/22. | ||
// | ||
|
||
import Foundation | ||
import MagicSDK | ||
|
||
public struct OpenIdConfiguration: BaseConfiguration { | ||
public var jwt: String | ||
public var providerId: String | ||
|
||
public init(jwt: String, providerId: String) { | ||
self.jwt = jwt | ||
self.providerId = providerId | ||
} | ||
} |
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,7 @@ | ||
import XCTest | ||
@testable import MagicExt_OIDC | ||
|
||
final class MagicExt_OIDCTests: XCTestCase { | ||
func testExample() throws { | ||
} | ||
} |