Skip to content
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

RSA and Jira support #394

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Noambaron
Copy link
Contributor

This adds OAuth1 SHA1-RSA and Jira support

Noam Bar-on added 5 commits July 11, 2017 16:28
* master:
  Add into demo code example for safari handler factory OAuthSwift#386
  Update README.md
  Fix memory leak due to strong reference of controller
  readme/atlassian

# Conflicts:
#	README.md
// MARK: Jira
func doOAuthJira(_ serviceParameters: [String:String]){
assert(Bundle.main.path(forResource: "private", ofType: "pem") != nil, "Jira authentication uses RSA-SHA1 which requires a stighlty different setup - see README.md for details.")
let oauthswift = OAuth1Swift.initWithRSA(
Copy link
Member

Choose a reason for hiding this comment

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

could add something like that

let jiraURL = serviceParameters["url"] ?? "https://yourinstance.atlassian.net"

and then use it in the following code, allowing to use in config file a custom url

//

import Foundation
import SwiftyRSA
Copy link
Member

Choose a reason for hiding this comment

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

So OAuthSwift become dependant on SwiftyRSA
So OAuthSwift.podspec and Package.swift must be updated

But for carthage a Cartfile must be created, and see the comment on Podfile

platform :ios, '8.3'
pod 'SwiftyRSA', '~> 1.2.0'
end

Copy link
Member

Choose a reason for hiding this comment

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

By becoming dependant and make OAuthSwift target dependant on this I suspect that the project file has been updated to work only with cocoapod
So opening the projet without the workspace will failed
And then Carthage could not work.

I could do the fix later

Then for macOS? :p

@@ -16,24 +16,24 @@ public protocol OAuthSwiftCredentialHeadersFactory {
open class OAuthSwiftCredential: NSObject, NSCoding {

public enum Version {
case oauth1, oauth2
case oauth1, oauth1RSA, oauth2
Copy link
Member

Choose a reason for hiding this comment

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

After merging I will do some change, try to remove this case oauth1RSA
by cutting the link between version and signature or use oauth1(SignatureMethod)

@phimage
Copy link
Member

phimage commented Feb 4, 2018

I make some change in last version allowing to make dependencies injection.

The class RSA in this PR could implement the new protocol OAuthSwiftSignatureDelegate

then to inject

OAuthSwiftCredential.SignatureMethod.delegates[.RSA_SHA1: RSA.Type)

So a new project OAuthSwiftRSA dependent on OAuthSwift and SwiftyRSA could be created
with the RSA class
A specific demo with JIRA could be created.

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.

None yet

2 participants