[PR #390] [CLOSED] Refactor o auth swift credential #622

Closed
opened 2026-03-03 16:49:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/390
Author: @Noambaron
Created: 7/6/2017
Status: Closed

Base: masterHead: refactor-OAuthSwiftCredential


📝 Commits (2)

  • 3f8607b OAuthSwiftCredential refactor and redesign
  • 9542416 Merge branch 'master' into rsa-support

📊 Changes

17 files changed (+496 additions, -161 deletions)

View changed files

📝 Demo/Common/Images.xcassets/AppIcon.appiconset/Contents.json (+5 -0)
📝 OAuthSwift.xcodeproj/project.pbxproj (+142 -10)
Sources/Credential/Concrete Credential Classes/HMAC_SHA1SignatureMethod.swift (+22 -0)
Sources/Credential/Concrete Credential Classes/OAuth1SwiftCredential.swift (+36 -0)
Sources/Credential/Concrete Credential Classes/OAuth1Version.swift (+18 -0)
Sources/Credential/Concrete Credential Classes/OAuth2SwiftCredential.swift (+27 -0)
Sources/Credential/Concrete Credential Classes/OAuth2Version.swift (+18 -0)
📝 Sources/Credential/Credential Base Classes/BaseOAuthSwiftCredential.swift (+54 -134)
Sources/Credential/Credential Base Classes/BaseOAuthSwiftSignatureMethod.swift (+34 -0)
Sources/Credential/Credential Base Classes/BaseOAuthSwiftVersion.swift (+38 -0)
Sources/Credential/Credential Protocols/OAuthSwiftCredential.swift (+53 -0)
Sources/Credential/Credential Protocols/OAuthSwiftSignatureMethod.swift (+17 -0)
Sources/Credential/Credential Protocols/OAuthSwiftVersion.swift (+17 -0)
📝 Sources/OAuth1Swift.swift (+2 -3)
📝 Sources/OAuth2Swift.swift (+1 -2)
📝 Sources/OAuthSwift.swift (+3 -3)
📝 Sources/OAuthSwiftClient.swift (+9 -9)

📄 Description

This refactors OAuthSwiftCredentials to be more flexible and extendable. No underlying implementation changed.

It uses a protocol based approach with base classes that implement common functionality, and concrete subclasses for specific credentials. This approach allows easy adjustment and enhancement and lays the ground for RSA support (That will follow in next PR).

OAuthSwiftCredentials is broken down into 3 protocols (OAuthSwiftCredential, OAuthSwiftSignatureMethod and OAuthSwiftVersion), There are also 3 base classes respectfully implementing common aspects of the protocols, and concrete classes for OAuth1, OAuth2 and HMAC-SHA1 that implement the specific parts.

Next PR will add RSA-SHA1 signatureMethod to extend functionality.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OAuthSwift/OAuthSwift/pull/390 **Author:** [@Noambaron](https://github.com/Noambaron) **Created:** 7/6/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `refactor-OAuthSwiftCredential` --- ### 📝 Commits (2) - [`3f8607b`](https://github.com/OAuthSwift/OAuthSwift/commit/3f8607b25a5b6929bf8f14fd36fa8b9702b37d08) OAuthSwiftCredential refactor and redesign - [`9542416`](https://github.com/OAuthSwift/OAuthSwift/commit/9542416e0972752980c928f225fa31058ee547b0) Merge branch 'master' into rsa-support ### 📊 Changes **17 files changed** (+496 additions, -161 deletions) <details> <summary>View changed files</summary> 📝 `Demo/Common/Images.xcassets/AppIcon.appiconset/Contents.json` (+5 -0) 📝 `OAuthSwift.xcodeproj/project.pbxproj` (+142 -10) ➕ `Sources/Credential/Concrete Credential Classes/HMAC_SHA1SignatureMethod.swift` (+22 -0) ➕ `Sources/Credential/Concrete Credential Classes/OAuth1SwiftCredential.swift` (+36 -0) ➕ `Sources/Credential/Concrete Credential Classes/OAuth1Version.swift` (+18 -0) ➕ `Sources/Credential/Concrete Credential Classes/OAuth2SwiftCredential.swift` (+27 -0) ➕ `Sources/Credential/Concrete Credential Classes/OAuth2Version.swift` (+18 -0) 📝 `Sources/Credential/Credential Base Classes/BaseOAuthSwiftCredential.swift` (+54 -134) ➕ `Sources/Credential/Credential Base Classes/BaseOAuthSwiftSignatureMethod.swift` (+34 -0) ➕ `Sources/Credential/Credential Base Classes/BaseOAuthSwiftVersion.swift` (+38 -0) ➕ `Sources/Credential/Credential Protocols/OAuthSwiftCredential.swift` (+53 -0) ➕ `Sources/Credential/Credential Protocols/OAuthSwiftSignatureMethod.swift` (+17 -0) ➕ `Sources/Credential/Credential Protocols/OAuthSwiftVersion.swift` (+17 -0) 📝 `Sources/OAuth1Swift.swift` (+2 -3) 📝 `Sources/OAuth2Swift.swift` (+1 -2) 📝 `Sources/OAuthSwift.swift` (+3 -3) 📝 `Sources/OAuthSwiftClient.swift` (+9 -9) </details> ### 📄 Description This refactors OAuthSwiftCredentials to be more flexible and extendable. No underlying implementation changed. It uses a protocol based approach with base classes that implement common functionality, and concrete subclasses for specific credentials. This approach allows easy adjustment and enhancement and lays the ground for RSA support (That will follow in next PR). OAuthSwiftCredentials is broken down into 3 protocols (OAuthSwiftCredential, OAuthSwiftSignatureMethod and OAuthSwiftVersion), There are also 3 base classes respectfully implementing common aspects of the protocols, and concrete classes for OAuth1, OAuth2 and HMAC-SHA1 that implement the specific parts. Next PR will add RSA-SHA1 signatureMethod to extend functionality. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:49:46 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#622
No description provided.