Skip to content

Commit

Permalink
OKTA-522764 - Push SDK: Fix spelling mistake in parameter name (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
IldarAbdullin-okta authored Aug 9, 2022
1 parent 6bf4d03 commit 6a07895
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct AuthenticatorMetaDataModel: Codable {
struct Settings: Codable {
let appInstanceId: String?
let userVerification: UserVerificationSetting?
let oauthCliendId: String?
let oauthClientId: String?

public enum UserVerificationSetting {
case preferred
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class AuthenticatorEnrollment: AuthenticatorEnrollmentProtocol {
activationToken: nil,
orgHost: organization.url,
authenticatorKey: policy.metadata.key,
oidcClientId: policy.metadata.settings?.oauthCliendId,
oidcClientId: policy.metadata.settings?.oauthClientId,
pushToken: DeviceToken.tokenData(token),
enrollBiometricKey: nil,
deviceSignals: nil,
Expand Down Expand Up @@ -189,7 +189,7 @@ class AuthenticatorEnrollment: AuthenticatorEnrollmentProtocol {
activationToken: nil,
orgHost: orgHost,
authenticatorKey: policy.metadata.id,
oidcClientId: policy.metadata.settings?.oauthCliendId,
oidcClientId: policy.metadata.settings?.oauthClientId,
pushToken: deviceToken,
enrollBiometricKey: enable,
deviceSignals: nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class AuthenticatorObjectTests: XCTestCase {
XCTAssertEqual(metaData.key, "okta_verify")
XCTAssertEqual(metaData.type, "APP")
XCTAssertEqual(metaData._embedded.methods.count, 3)
XCTAssertEqual(metaData.settings?.oauthClientId, "someOAuth2ClientId")
metaData._embedded.methods.forEach({ authenticatorType in
if authenticatorType.type == .totp {
XCTAssertEqual(authenticatorType.status, "INACTIVE")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ class AuthenticatorPolicyTests: XCTestCase {
XCTAssertEqual(policy.userVerificationSetting, .preferred)

policy = AuthenticatorPolicy(metadata: createMetadataWithSettings(
AuthenticatorMetaDataModel.Settings(appInstanceId: nil, userVerification: nil, oauthCliendId: nil)
AuthenticatorMetaDataModel.Settings(appInstanceId: nil, userVerification: nil, oauthClientId: nil)
))
XCTAssertEqual(policy.userVerificationSetting, .preferred)

policy = AuthenticatorPolicy(metadata: createMetadataWithSettings(
AuthenticatorMetaDataModel.Settings(appInstanceId: nil, userVerification: .preferred, oauthCliendId: nil)
AuthenticatorMetaDataModel.Settings(appInstanceId: nil, userVerification: .preferred, oauthClientId: nil)
))
XCTAssertEqual(policy.userVerificationSetting, .preferred)

policy = AuthenticatorPolicy(metadata: createMetadataWithSettings(
AuthenticatorMetaDataModel.Settings(appInstanceId: nil, userVerification: .required, oauthCliendId: nil)
AuthenticatorMetaDataModel.Settings(appInstanceId: nil, userVerification: .required, oauthClientId: nil)
))
XCTAssertEqual(policy.userVerificationSetting, .required)

policy = AuthenticatorPolicy(metadata: createMetadataWithSettings(
AuthenticatorMetaDataModel.Settings(appInstanceId: nil, userVerification: .unknown(""), oauthCliendId: nil)
AuthenticatorMetaDataModel.Settings(appInstanceId: nil, userVerification: .unknown(""), oauthClientId: nil)
))
XCTAssertEqual(policy.userVerificationSetting, .unknown(""))
}
Expand Down
6 changes: 4 additions & 2 deletions Tests/DeviceAuthenticatorUnitTests/Mocks/GoldenData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class GoldenData {
"lastUpdated": "2017-01-24T19:52:34.000Z",
"settings": {
"appInstanceId": "oidcAppId1234",
"userVerification": "preferred"
"userVerification": "preferred",
"oauthClientId": "someOAuth2ClientId"
},
"_links": {
"enroll": {
Expand Down Expand Up @@ -82,7 +83,8 @@ class GoldenData {
"lastUpdated": "2017-01-24T19:52:34.000Z",
"settings": {
"appInstanceId": "oidcAppId1234",
"userVerification": "preferred"
"userVerification": "preferred",
"oauthClientId": "someOAuth2ClientId"
},
"_links": {
"self": {
Expand Down
2 changes: 1 addition & 1 deletion Tests/DeviceAuthenticatorUnitTests/Mocks/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class TestUtils {
methods: [AuthenticatorMethod] = [.push, .signedNonce]) -> AuthenticatorMetaDataModel {
let settings = AuthenticatorMetaDataModel.Settings(appInstanceId: nil,
userVerification: userVerification,
oauthCliendId: nil)
oauthClientId: nil)

var embeddedMethods = [AuthenticatorMetaDataModel.Method]()
for method in methods {
Expand Down

0 comments on commit 6a07895

Please sign in to comment.