- Added a shared TrustValidation.extractServerTrust helper to central… - #15
Conversation
…ize SecTrust extraction and logging, simplifying both pinning delegates.
- CertificateCAPinning and PublicKeyServerPinning now reuse it and emit consistent success/failure messages.
- Renamed BearerReqeustAuthorizer to BearerRequestAuthorizer, added optional logger injection to both Basic and Bearer authorizers, and updated their logging
internals
PR Compliance Guide 🔍(Compliance updated until commit ea8a853)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 56d04c5
Compliance check up to commit 160f225
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
PR Type
Enhancement, Bug fix
Description
Centralized SecTrust extraction logic into new
TrustValidation.extractServerTrusthelperUnified error messages and logging across pinning delegates for consistency
Refactored pinning validation logic using guard statements for clarity
Added optional logger injection to Basic and Bearer authorizers
Fixed typo: renamed
BearerReqeustAuthorizertoBearerRequestAuthorizerDiagram Walkthrough
File Walkthrough
TrustValidation.swift
New shared trust validation helperSources/SwiftRestRequests/security/TrustValidation.swift
extractServerTruststatic method that validates and logsmissing trust
CertificateCAPinning.swift
Refactor to use centralized trust validationSources/SwiftRestRequests/security/CertificateCAPinning.swift
TrustValidation.extractServerTrustcallPublicKeyServerPinning.swift
Refactor to use centralized trust validationSources/SwiftRestRequests/security/PublicKeyServerPinning.swift
TrustValidation.extractServerTrustcallURLRequestAuthorizer.swift
Add optional logger injection and fix typoSources/SwiftRestRequests/security/URLRequestAuthorizer.swift
loggerparameter toBasicRequestAuthorizerconstructorwith default value
loggerparameter toBearerRequestAuthorizerconstructorwith default value
BearerReqeustAuthorizertoBearerRequestAuthorizerRestApiCallerSecurityTests.swift
Update test for renamed authorizer classTests/SwiftRestRequestsTests/RestApiCallerSecurityTests.swift
BearerRequestAuthorizerinstantiation