Skip to content

chore: Add Context Values #226

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

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Conversation

AlejandroOrozco
Copy link
Contributor

@AlejandroOrozco AlejandroOrozco commented Feb 21, 2025

Ticket

  • [#####]

Github Issue

  • ISSUE-

Description

  • Add Support to Xcode 16.3
  • Migrate from deprecated methods of KeyPair Generation.
  • Add Context Values.

Commit message

Screenshot

Testing

  • Added unit tests
  • Ran unit tests successfully
  • Added documentation for public APIs and/or Wiki

@AlejandroOrozco AlejandroOrozco force-pushed the feature/AddContextValues branch 13 times, most recently from 613d747 to f404268 Compare February 22, 2025 00:27
@AlejandroOrozco AlejandroOrozco force-pushed the feature/AddContextValues branch 2 times, most recently from beade08 to f404268 Compare February 28, 2025 22:40
- run:
name: Setup Certificate and Keychain
command: |
# create variables
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be a script?

match(
type: "development",
app_identifier: ["com.twilio.verify.HostApp"]
# match(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be removed?

type: "development",
app_identifier: ["com.twilio.verify.AppSizer"]
)
# match(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove the Matchfile?

@yafuquen yafuquen marked this pull request as ready for review March 17, 2025 18:37
@yafuquen yafuquen requested a review from SergioFierro as a code owner March 17, 2025 18:37
@AlejandroOrozco AlejandroOrozco force-pushed the feature/AddContextValues branch 2 times, most recently from ac6f56e to e6c4c0b Compare March 19, 2025 22:05
@AlejandroOrozco AlejandroOrozco force-pushed the feature/AddContextValues branch 6 times, most recently from b1c2cb9 to 7720a48 Compare March 19, 2025 23:01
@AlejandroOrozco AlejandroOrozco changed the base branch from main to dev April 24, 2025 15:32
AlejandroOrozco and others added 2 commits April 24, 2025 10:34
* fix: Gemfile to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-RUBY-REXML-6861566

* Update CircleCI Resources

---------

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
AlejandroOrozco and others added 5 commits April 24, 2025 10:34
* Fix unit test crashing

* Fix flaky test

* Print received error

* Support error when creating keypair with invalid parameters

* Test device

* Update iOS version to 12

* feat: Support Xcode 16.3 (#229)

* feat: Support Xcode 16.3

* feat: Update project to testplans

---------

Co-authored-by: Yeimi Moreno <ymoreno@twilio.com>
Co-authored-by: Alejandro Orozco <aorozcobuiles@twilio.com>
@AlejandroOrozco AlejandroOrozco force-pushed the feature/AddContextValues branch from 3011c7e to 88eb0d9 Compare April 24, 2025 15:42
@@ -154,8 +158,8 @@ class FactorAPIClientTests: XCTestCase {
"Authorization header should not be nil")
XCTAssertNotNil(networkProvider.urlRequest?.allHTTPHeaderFields![HTTPHeader.Constant.userAgent],
"User agent header should not be nil")
XCTAssertEqual(String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self), params.asString(),
"Body should be \(params.asString()) but was \(networkProvider.urlRequest!.httpBody!)")
XCTAssert(String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self) == params.asString() || String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self) == paramsv2.asString(),

Choose a reason for hiding this comment

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

⚠️ Line should be 195 characters or less; currently it has 203 characters
line_length FactorAPIClientTests.swift:161

@@ -154,8 +158,8 @@ class FactorAPIClientTests: XCTestCase {
"Authorization header should not be nil")
XCTAssertNotNil(networkProvider.urlRequest?.allHTTPHeaderFields![HTTPHeader.Constant.userAgent],
"User agent header should not be nil")
XCTAssertEqual(String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self), params.asString(),
"Body should be \(params.asString()) but was \(networkProvider.urlRequest!.httpBody!)")
XCTAssert(String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self) == params.asString() || String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self) == paramsv2.asString(),

Choose a reason for hiding this comment

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

⚠️ Prefer failable String(data:encoding:) initializer when converting Data to String
optional_data_string_conversion FactorAPIClientTests.swift:161

XCTAssertEqual(String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self), params.asString(),
"Body should be \(params.asString()) but was \(networkProvider.urlRequest!.httpBody!)")
XCTAssert(String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self) == params.asString() || String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self) == paramsv2.asString(),
"Body should be \(params.asString()) or \(paramsv2.asString()) but was \(String(decoding: networkProvider.urlRequest!.httpBody!, as: UTF8.self))")

Choose a reason for hiding this comment

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

⚠️ Prefer failable String(data:encoding:) initializer when converting Data to String
optional_data_string_conversion FactorAPIClientTests.swift:162

@AuthyApps
Copy link

25 Warnings
⚠️ Big PR
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Key/Template/ECP256SignerTemplateTests.swift#L23 - Use 'next', 'this' or 'previous' instead to disable the 'force_cast' rule once, or re-enable it as soon as possible blanket_disable_command ECP256SignerTemplateTests.swift:23`
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L23 - Use 'next', 'this' or 'previous' instead to disable the 'force_cast' rule once, or re-enable it as soon as possible blanket_disable_command KeychainTests.swift:23`
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L23 - Use 'next', 'this' or 'previous' instead to disable the 'type_body_length' rule once, or re-enable it as soon as possible blanket_disable_command KeychainTests.swift:23`
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L90 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion KeychainTests.swift:90
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L124 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion KeychainTests.swift:124
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L142 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion KeychainTests.swift:142
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L161 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion KeychainTests.swift:161
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L178 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion KeychainTests.swift:178
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L301 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion KeychainTests.swift:301
⚠️ TwilioVerifySDKTests/TwilioSecurity/Sources/Keychain/KeychainTests.swift#L404 - File should contain 400 lines or less: currently contains 404
file_length KeychainTests.swift:404
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L23 - Use 'next', 'this' or 'previous' instead to disable the 'type_body_length' rule once, or re-enable it as soon as possible blanket_disable_command FactorAPIClientTests.swift:23`
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L23 - Use 'next', 'this' or 'previous' instead to disable the 'force_cast' rule once, or re-enable it as soon as possible blanket_disable_command FactorAPIClientTests.swift:23`
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L41 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:41
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L114 - Prefer failable String(data:encoding:) initializer when converting Data to String
optional_data_string_conversion FactorAPIClientTests.swift:114
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L167 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:167
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L182 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:182
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L249 - Prefer failable String(data:encoding:) initializer when converting Data to String
optional_data_string_conversion FactorAPIClientTests.swift:249
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L259 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:259
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L286 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:286
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L317 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:317
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L349 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:349
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L364 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:364
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L435 - Prefer failable String(data:encoding:) initializer when converting Data to String
optional_data_string_conversion FactorAPIClientTests.swift:435
⚠️ TwilioVerifySDKTests/TwilioVerify/Sources/API/FactorAPIClientTests.swift#L475 - Prefer non-optional Data(_:) initializer when converting String to Data
non_optional_string_data_conversion FactorAPIClientTests.swift:475

Code coverage

Total coverage: 94.26%

File Coverage
TwilioVerifySDK/TwilioSecurity/Sources/Key/Template/ECP256SignerTemplate.swift 93.02%
TwilioVerifySDK/TwilioSecurity/Sources/Keychain/Keychain.swift 88.83%

Powered by Slather

Generated by 🚫 Danger

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.

4 participants