-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/merge remove binary target #23
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
ivolz
wants to merge
29
commits into
main
Choose a base branch
from
feature/merge-remove-binary-target
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
070ed8f
feat: Add documentation and integrate ApproovServiceMutator
7314ca8
feat: Add setUseApproovStatusIfNoToken
b0ba848
docs: Document setUseApproovStatusIfNoToken configuration
87172cb
feat: Add configurable ApproovLogLevel and setLoggingLevel API
b9552a1
Add loLevel description
4e92a88
fix: change loggingLevel from private to internal access
4382675
Add swift pm changes to Approov binary dependency; increase package v…
374e4fd
Remove test file
c399434
Module name for cocoapods spec file now matches swift pm
5b16bc5
Update documentation to reflect package name change
5ae8fde
Add a getter for current token header
5cf6637
fix: restore mutator compatibility and align Alamofire docs with curr…
6824a9d
fix: Approov exception for SDK already initialized is not based on st…
48ae004
USAGE.md now reflects multiple service layers using the same platform…
ed080ce
Add sfv library dependency to support message signing in podspec
55aa5b3
Update docs
89c3275
fix: restore network failure throws in interceptor handlers and gate …
0dc3e9f
Update version info
bfedf72
Update version info
39283ae
Merge branch 'feature/merge-remove-binary-target' of github.com:appro…
3bc9b5a
fix: implement backward-compatible processedRequest in ApproovDefault…
f63bbe5
fix: remove contradiction allowing unprotectedURL to undergo header s…
5e68c9a
build: add Alamofire dependency to podspec to match SwiftPM
b742380
Fix link to status token fetch
805d5b5
Minor changes to logging events
18b1b87
Add Alamofire specific configuration options
b7e9351
Update reference file
0287593
Remove log file
0a2c170
Add missing error types
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,52 @@ | ||
|
|
||
| # AlamoFire Options | ||
| This provides some other options available with the AlamoFire networking stack. | ||
|
|
||
| ## Network Retry Options | ||
| The `ApproovInterceptor` class implements Alamofire's Interceptor protocol which includes an option to invoke a retry attempt in case the original request failed. We do not implement the retry option in `ApproovInterceptor`, but if you require implementing one, you should mimic the contents of the `adapt()` function and perhaps add some logic regarding retry attempts. See an example [here](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#adapting-and-retrying-requests-with-requestinterceptor). | ||
|
|
||
| ## Trust Manager | ||
| The `ApproovSession` object internally handles the creation of a default `AproovTrustManager` that handles dynamic pinning. You may set your own `ServerTrustManager` during construction like so: | ||
|
|
||
| ```swift | ||
| let session = ApproovSession(serverTrustManager: manager) | ||
| ``` | ||
| However, if you do this then Approov dynamic pinning WILL NOT be applied. | ||
|
|
||
| An alternative is to use the `ApproovTrustManager` along with your own `ServerTrustEvaluating` implementations as follows: | ||
|
|
||
| ```swift | ||
| let evaluators: [String: ServerTrustEvaluating] = [ | ||
| "some.other.host.com": RevocationTrustEvaluator(), | ||
| "another.host": PinnedCertificatesTrustEvaluator() | ||
| ] | ||
| let manager = ApproovTrustManager(allHostsMustBeEvaluated: true, evaluators: evaluators) | ||
| let session = ApproovSession(serverTrustManager: manager) | ||
| ``` | ||
|
|
||
| This approach will use the Approov dynamic pinning for all hosts that are being [mangaged](https://approov.io/docs/latest/approov-usage-documentation/#managing-api-domains) by Approov. Other host names will be passed to your custom evaluators. If you specify an evaluator that is also managed by Approov, then Approov will take precedence. | ||
|
|
||
| ### Alamofire Request | ||
| If your code makes use of the default Alamofire `Session`, like so: | ||
|
|
||
| ```swift | ||
| AF.request("https://httpbin.org/get").response { response in | ||
| debugPrint(response) | ||
| } | ||
| ``` | ||
|
|
||
| all you will need to do to use Approov is to replace the default `Session` object with the `ApproovSession`: | ||
|
|
||
| ```swift | ||
| let approovSession = ApproovSession() | ||
| approovSession!.request("https://httpbin.org/get").responseData { response in | ||
| debugPrint(response) | ||
| } | ||
| ``` | ||
|
|
||
| ## Network Delegate | ||
| You may specify your own network delegate when the `ApproovSession` is constructed as follows: | ||
|
|
||
| ```swift | ||
| let session = ApproovSession(delegate: delegate) | ||
| ``` |
This file contains hidden or 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 hidden or 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,28 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this package will be documented in this file. | ||
|
|
||
| The format is based on Keep a Changelog and this project adheres to Semantic Versioning. | ||
|
|
||
|
|
||
| ## [3.5.5] - 2026-03-06 | ||
|
|
||
| ### Fixed | ||
| - Made `loggingLevel` thread-safe with a dedicated `loggingQueue` to prevent data races on concurrent reads/writes. | ||
| - Gated all `os_log` calls in `ApproovTrustManager` behind `ApproovService.loggingLevel` so that `setLoggingLevel` controls all package logging consistently. | ||
| - Fixed logging level guard mismatch in `ApproovDefaultMessageSigning` (`.info` → `.error`) and gated additional debug logs. | ||
|
|
||
| ### Added | ||
| - Added `REFERENCE.md` and `USAGE.md` documentation to match other Approov Swift service layers. | ||
| - Separated `CHANGELOG.md` from the primary README for better discoverability. | ||
| - Introduced `ApproovServiceMutator` interface to allow customizing the behavior of the `ApproovService` during attestation and interception flows without forking the project. | ||
| - Added `setUseApproovStatusIfNoToken` configuration to `ApproovService`. When enabled, failure reasons (like `mitm_detected` or `no_network`) are placed in the Approov-Token header if a request proceeds without a valid token. | ||
| - Added `setLoggingLevel(_ level: ApproovLogLevel)` configuration for fine-grained control over the package's internal `os_log` statements. Supports `.off`, `.error`, `.warning`, `.info`, and `.debug`. | ||
| ### Changed | ||
| - `ApproovDefaultMessageSigning` now gracefully skips signing and proceeds with the request without throwing an error if the install message signature is unavailable. | ||
| - `ApproovDefaultMessageSigning` now implements `ApproovServiceMutator` instead of `ApproovInterceptorExtensions`. | ||
| - `ApproovDefaultMessageSigning` now checks for the configured Approov token header via an internal synchronized accessor instead of assuming `Approov-Token`. | ||
| ### Deprecated | ||
| - `ApproovInterceptorExtensions` was replaced by the much more robust `ApproovServiceMutator` protocol. The deprecated `setApproovInterceptorExtensions` API now forwards to `setServiceMutator` for backward compatibility. | ||
| ### Removed | ||
| - `setProceedOnNetworkFailure()` has been removed. Use the `ApproovServiceMutator` instead to customize behavior on network failures. See `USAGE.md` for examples of how to implement a custom mutator. | ||
ivolz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.