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

Introduce deprecation warnings to assist in migrating from OktaIdx 2.x #112

Merged
merged 2 commits into from Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 46 additions & 0 deletions Sources/OktaIdx/Extensions/DeprecationWarnings.swift
@@ -0,0 +1,46 @@
//
// Copyright (c) 2022-Present, Okta, Inc. and/or its affiliates. All rights reserved.
// The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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.
//

import Foundation

@available (*, unavailable, renamed: "InteractionCodeFlow")
public struct IDXClient {
@available (*, unavailable)
public struct Configuration {
@available (*, unavailable)
public init(issuer: String,
clientId: String,
clientSecret: String?,
scopes: [String],
redirectUri: String) {}
}

@available (*, unavailable)
public enum Option: Hashable {}

@available (*, unavailable,
emmanuelogunmuyiwa-okta marked this conversation as resolved.
Show resolved Hide resolved
renamed: "start(options:completion:)",
message: "IDXClient replaced with InteractionCodeFlow")
public static func start(with configuration: Any,
options: [Option: String]? = nil,
completion: @escaping (Result<IDXClient, Error>) -> Void) {}

@available (*, unavailable,
renamed: "start(options:completion:)",
message: "IDXClient replaced with InteractionCodeFlow")
public static func start(with configuration: Configuration,
options: [String: String]? = nil,
completion: @escaping (_ client: IDXClient?, _ error: Error?) -> Void) {}

@available (*, unavailable)
public func resume(completion: ((Result<Response, Error>) -> Void)?) {}
}
11 changes: 11 additions & 0 deletions Sources/OktaIdx/OktaIdx.docc/OktaIdx.md
Expand Up @@ -7,6 +7,7 @@ Authenticate users using policy-driven native authentication with the Okta Ident
### Essentials

- ``InteractionCodeFlow``
- ``InteractionCodeFlowDelegate``
- ``Response``
- ``Remediation``

Expand Down Expand Up @@ -35,6 +36,7 @@ Authenticate users using policy-driven native authentication with the Okta Ident

- ``Capability``
- ``CapabilityCollection``
- ``IDXCapability``
- ``AuthenticatorCapability``
- ``RemediationCapability``
- ``Capability/NumberChallenge``
Expand All @@ -46,3 +48,12 @@ Authenticate users using policy-driven native authentication with the Okta Ident
- ``Capability/Resendable``
- ``Capability/SocialIDP``
- ``Capability/OTP``

### Errors

- ``IDXServerError``
- ``InteractionCodeFlowError``

### Deprecations

- ``IDXClient``