Skip to content

Commit

Permalink
Add CONTRIBUTORS and CONTRIBUTING. After merge fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
p2 committed Mar 10, 2016
1 parent d66ffc3 commit 7515b77
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 30 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Version numbering represents the Swift version, plus a running number representi
You can also refer to commit logs to get details on what was implemented, fixed and improved.


### 2.2.2

- Add tvOS build (thanks @davidkraus and @ddengler !)
- Update SwiftKeychain integration (thanks @davidkraus and @ddengler !)


### 2.2.1

- Better error parsing when handling redirect URL in code grants
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Contributing
============

For fixes, improvements and ideas, fork the repository and issue a pull request.
To get a pull request accepted, please adhere to these two rules:

- Work from the latest `develop` branch, unless it's a very small fix
- Respect current code style (indent with tabs, compare to existing code for more clues)

Ideally, only work on one feature at a time.
If you've done work on the code (i.e. not just fixes to the README), add yourself to the top of [`CONTRIBUTORS.md`](./CONTRIBUTORS.md).

Happy coding!
13 changes: 13 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Contributors
============

Contributors to the codebase, in reverse chronological order:

David Kraus, @davidkraus
Daniel Dengler, @ddengler
Tyler Swartz, @tylerswartz
Guilherme Rambo, @insidegui
Glenn Schmidt, @glennschmidt
Tomohiro Kumagai, @ez-net
Tim Sneed, @trsneed
Vojto Rinik, @vojto
2 changes: 1 addition & 1 deletion OAuth2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@
EEDB8626193FAAE500C4EEA1 /* OAuth2 */ = {
isa = PBXGroup;
children = (
65EC05DF1C9050CB00DE9186 /* OAuth2KeychainAccount.swift */,
EEDB8640193FAB9200C4EEA1 /* OAuth2.swift */,
EEF47D2A1B1E3FDD0057D838 /* OAuth2Base.swift */,
EE79F6561BFA945C00746243 /* OAuth2ClientConfig.swift */,
EE79F6531BFA93D900746243 /* OAuth2AuthConfig.swift */,
65EC05DF1C9050CB00DE9186 /* OAuth2KeychainAccount.swift */,
EE79F65C1BFBDFFF00746243 /* Flows */,
EE507A371B1E15E000AE02E9 /* OAuth2DynReg.swift */,
EE29EABB195A0DB2008882C8 /* OAuth2Request.swift */,
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ OAuth2
[![Build Status](https://travis-ci.org/p2/OAuth2.svg?branch=master)](https://travis-ci.org/p2/OAuth2)
[![License](https://img.shields.io/:license-apache-blue.svg)](LICENSE.txt)

OAuth2 frameworks for **OS X** and **iOS** written in Swift 2.0.
OAuth2 frameworks for **OS X**, **iOS** and **tvOS** written in Swift 2.0.

Technical documentation is available at [p2.github.io/OAuth2](https://p2.github.io/OAuth2).
Take a look at the [OS X sample app][sample] for basic usage of this framework.

The code in this repo requires Xcode 7, the built framework can be used on **OS X 10.9** or **iOS 8** and later.
To use on **iOS 7** you'll have to include the source files in your main project.
Happy to accept pull requests, please see [CONTRIBUTING.md](./CONTRIBUTING.md)

#### Swift Version

Expand Down
8 changes: 3 additions & 5 deletions Sources/Base/OAuth2Base.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
//

import Foundation
#if IMPORT_SWIFT_KEYCHAIN // experimental for SwiftKeychain integration via CocoaPods (iOS only)
import SwiftKeychain
#elseif !NO_KEYCHAIN_IMPORT // needs to be imported when using `swift build`, not when building via Xcode
import SwiftKeychain
#if !NO_KEYCHAIN_IMPORT // needs to be imported when using `swift build` or with CocoaPods, not when building via Xcode
import SwiftKeychain
#endif


Expand Down Expand Up @@ -156,7 +154,7 @@ public class OAuth2Base {
}
}
}

/** Unsets the client credentials and deletes them from the keychain. */
public func forgetClient() {
logIfVerbose("Forgetting client credentials and removing them from keychain")
Expand Down
25 changes: 20 additions & 5 deletions Sources/Base/OAuth2KeychainAccount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,28 @@
// Created by David Kraus on 09/03/16.
// Copyright © 2016 Pascal Pfiffner. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation
#if IMPORT_SWIFT_KEYCHAIN // experimental for SwiftKeychain integration via CocoaPods (iOS only)
import SwiftKeychain
#elseif !NO_KEYCHAIN_IMPORT // needs to be imported when using `swift build`, not when building via Xcode
import SwiftKeychain
#if !NO_KEYCHAIN_IMPORT // needs to be imported when using `swift build` or with CocoaPods, not when building via Xcode
import SwiftKeychain
#endif


/**
Base keychain integration handler for OAuth2.
*/
struct OAuth2KeychainAccount: KeychainGenericPasswordType {
let accountName: String
let internalServiceName: String
Expand All @@ -32,4 +46,5 @@ struct OAuth2KeychainAccount: KeychainGenericPasswordType {
self.accountName = name
self.data = data
}
}
}

2 changes: 1 addition & 1 deletion Sources/iOS/OAuth2+iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ extension OAuth2 {
*/
@available(iOS 9.0, *)
func safariViewControllerDidCancel(safari: SFSafariViewController) {
// authConfig.ui.safariViewDelegate = nil
authConfig.ui.safariViewDelegate = nil
didFail(nil)
}

Expand Down
33 changes: 24 additions & 9 deletions Sources/tvOS/OAuth2+tvOS.swift
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
import UIKit
//
// OAuth2+iOS.swift
// OAuth2
//
// Created by David Kraus on 11/26/15.
// Copyright 2015 Pascal Pfiffner
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//


extension OAuth2 {

// no webview or webbrowser available on tvOS

public final func openAuthorizeURLInBrowser(params: [String: String]? = nil) -> Bool {
fatalError("Not implemented")
}

public func authorizeEmbeddedWith(config: OAuth2AuthConfig, params: [String: String]? = nil, autoDismiss: Bool = true) -> Bool {
fatalError("Not implemented")
public final func openAuthorizeURLInBrowser(params: OAuth2StringDict? = nil) throws {
throw OAuth2Error.Generic("Not implemented")
}

public func authorizeEmbeddedFrom(controller: UIViewController, params: [String: String]?) -> AnyObject {
fatalError("Not implemented")
public func authorizeEmbeddedWith(config: OAuth2AuthConfig, params: OAuth2StringDict? = nil) throws {
throw OAuth2Error.Generic("Not implemented")
}
}

15 changes: 7 additions & 8 deletions p2.OAuth2.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

Pod::Spec.new do |s|
s.name = "p2.OAuth2"
s.version = "2.2.1"
s.summary = "OAuth2 framework for OS X and iOS, written in Swift."
s.version = "2.2.2"
s.summary = "OAuth2 framework for OS X, iOS and tvOS, written in Swift."
s.description = <<-DESC
OAuth2 frameworks for OS X and iOS written in Swift.
OAuth2 frameworks for OS X, iOS and tvOS written in Swift.
A flexible framework supporting standards-compliant _implicit_ and _code_ grant flows. Some
websites like Facebook may use slightly differring OAuth2 implementations, for those the
Expand All @@ -25,16 +25,15 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/p2/OAuth2.git", :tag => "#{s.version}", :submodules => true }

s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.9"
s.tvos.deployment_target = '9.0'
s.osx.deployment_target = "10.10"
s.tvos.deployment_target = "9.0"
s.requires_arc = true
s.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-DIMPORT_SWIFT_KEYCHAIN' }

s.source_files = "Sources/Base/*.swift"
s.ios.source_files = "Sources/iOS/*.swift"
s.osx.source_files = "Sources/OSX/*.swift"
s.tvos.source_files = "Sources/tvOS/*.swift"

s.dependency 'SwiftKeychain', '~> 1.0'
s.ios.framework = 'SafariServices'
s.dependency "SwiftKeychain", "~> 1.0"
s.ios.framework = "SafariServices"
end

0 comments on commit 7515b77

Please sign in to comment.