-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplification + Implement OIDC (#185)
* Introduce `WultraMobileToken` object which directly instantiates services * Replace `WMT` throwing init for failable init * Simplify WMT class, revert init? to throwing init, code cleanup * WIP: docs * Fix access modifiers * Draft WMTOperations generics * Improve Operations service * Update docs * Add migration guide to readme * Revert WMTOperations generics * Change file copyright header for the SDK correct one * Remove unnecessary debug print()s * Remove unused generics in operation expoints * Implement WMTOidcService * Add OidcTests * Move WultraMobileToken.swift to Common and update podspec to include all files * Fix circular dependency of sub.dependencies in .podspec * Add Oidc to subspec * Fix Push `pushNotificationsRegisteredOnServer` visibility * Change Oidc service name to be consistent with other services and other refactoring * Remove incorrectly commited files * Fix refactor * Remove config dependent part of the test * Update after mtoken implementation testing * Improved WultraMobileToken class * Implement remarks * Remarks/rename to capital OIDC * Rename files * Rename prepareOIDCAuthorizationData method to omit redundant OIDC --------- Co-authored-by: Jan Kobersky <kober32@gmail.com>
- Loading branch information
1 parent
5b0da64
commit 31adc45
Showing
40 changed files
with
2,153 additions
and
799 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,41 @@ | ||
// | ||
// Copyright 2025 Wultra s.r.o. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions | ||
// and limitations under the License. | ||
// | ||
|
||
/// Lazy loaded instance with possibility of "peek". | ||
class WMTLazy<T> { | ||
|
||
private var instance: T? | ||
private let factory: () -> T | ||
private let lock = WMTLock() | ||
|
||
var lazy: T { | ||
return instance ?? lock.synchronized { | ||
if let instance = instance { | ||
return instance | ||
} | ||
self.instance = factory() | ||
return self.instance! | ||
} | ||
} | ||
|
||
var optional: T? { | ||
return instance | ||
} | ||
|
||
init(_ factory: @autoclosure @escaping () -> T) { | ||
self.factory = factory | ||
} | ||
} |
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
Oops, something went wrong.