FB Oauth is able to authorize users but still working on deauthorizing users

This commit is contained in:
Okechi Onyeje 2016-05-29 11:23:38 -04:00
parent a0e8b382b2
commit d96813b297
59 changed files with 7737 additions and 2293 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -13,6 +13,7 @@ target 'Vendoo' do
# pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'Alamofire-SwiftyJSON'
pod 'OAuthSwift', '~> 0.5.0'
pod 'AeroGearOAuth2'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

View File

@ -1,4 +1,7 @@
PODS:
- AeroGearHttp (0.5.1)
- AeroGearOAuth2 (0.5.1):
- AeroGearHttp
- AFNetworking (2.6.3):
- AFNetworking/NSURLConnection (= 2.6.3)
- AFNetworking/NSURLSession (= 2.6.3)
@ -78,6 +81,7 @@ PODS:
- SwiftyJSON (2.3.2)
DEPENDENCIES:
- AeroGearOAuth2
- Alamofire-SwiftyJSON
- FBSDKCoreKit
- FBSDKLoginKit
@ -89,6 +93,8 @@ DEPENDENCIES:
- PicoKit
SPEC CHECKSUMS:
AeroGearHttp: 9eb405b694aa9ac5daff842f68648f4a9fe0fa66
AeroGearOAuth2: 6f29d3fac8b78a0ff6d51b04c4ba1a02baed2e52
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
Alamofire: c19a627cefd6a95f840401c49ab1f124e07f54ee
Alamofire-SwiftyJSON: 5812bb37accc36897cc2f2dabb070d8ebcd7ac98
@ -110,6 +116,6 @@ SPEC CHECKSUMS:
PicoKit: 9079bce659a8d5408c8af1c45254b971df614de3
SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a
PODFILE CHECKSUM: b38736b343fb2b19e963a4b958d967b3d0cd4d11
PODFILE CHECKSUM: e5c9f5e7183188f117de0f8635164df8a5f04bf6
COCOAPODS: 1.0.0

View File

@ -0,0 +1,74 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
The protocol that authorization modules must adhere to.
*/
public protocol AuthzModule {
/**
Gateway to request authorization access.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
func requestAccess(completionHandler: (AnyObject?, NSError?) -> Void)
/**
Request an authorization code.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
func requestAuthorizationCode(completionHandler: (AnyObject?, NSError?) -> Void)
/**
Exchange an authorization code for an access token.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
func exchangeAuthorizationCodeForAccessToken(code: String, completionHandler: (AnyObject?, NSError?) -> Void)
/**
Request to refresh an access token.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
func refreshAccessToken(completionHandler: (AnyObject?, NSError?) -> Void)
/**
Request to revoke access.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
func revokeAccess(completionHandler: (AnyObject?, NSError?) -> Void)
/**
Return any authorization fields.
:returns: a dictionary filled with the authorization fields.
*/
func authorizationFields() -> [String: String]?
/**
Returns a boolean indicating whether authorization has been granted.
:returns: true if authorized, false otherwise.
*/
func isAuthorized() -> Bool
}

602
Pods/AeroGearHttp/AeroGearHttp/Http.swift generated Normal file
View File

@ -0,0 +1,602 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
The HTTP method verb:
- GET: GET http verb
- HEAD: HEAD http verb
- DELETE: DELETE http verb
- POST: POST http verb
- PUT: PUT http verb
*/
public enum HttpMethod: String {
case GET = "GET"
case HEAD = "HEAD"
case DELETE = "DELETE"
case POST = "POST"
case PUT = "PUT"
}
/**
The file request type:
- Download: Download request
- Upload: Upload request
*/
enum FileRequestType {
case Download(String?)
case Upload(UploadType)
}
/**
The Upload enum type:
- Data: for a generic NSData object
- File: for File passing the URL of the local file to upload
- Stream: for a Stream request passing the actual NSInputStream
*/
enum UploadType {
case Data(NSData)
case File(NSURL)
case Stream(NSInputStream)
}
/**
Error domain.
**/
public let HttpErrorDomain = "HttpDomain"
/**
Request error.
**/
public let NetworkingOperationFailingURLRequestErrorKey = "NetworkingOperationFailingURLRequestErrorKey"
/**
Response error.
**/
public let NetworkingOperationFailingURLResponseErrorKey = "NetworkingOperationFailingURLResponseErrorKey"
public typealias ProgressBlock = (Int64, Int64, Int64) -> Void
public typealias CompletionBlock = (AnyObject?, NSError?) -> Void
/**
Main class for performing HTTP operations across RESTful resources.
*/
public class Http {
var baseURL: String?
var session: NSURLSession
var requestSerializer: RequestSerializer
var responseSerializer: ResponseSerializer
public var authzModule: AuthzModule?
private var delegate: SessionDelegate
/**
Initialize an HTTP object.
:param: baseURL the remote base URL of the application (optional).
:param: sessionConfig the SessionConfiguration object (by default it uses a defaultSessionConfiguration).
:param: requestSerializer the actual request serializer to use when performing requests.
:param: responseSerializer the actual response serializer to use upon receiving a response.
:returns: the newly intitialized HTTP object
*/
public init(baseURL: String? = nil,
sessionConfig: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(),
requestSerializer: RequestSerializer = JsonRequestSerializer(),
responseSerializer: ResponseSerializer = JsonResponseSerializer()) {
self.baseURL = baseURL
self.delegate = SessionDelegate()
self.session = NSURLSession(configuration: sessionConfig, delegate: self.delegate, delegateQueue: NSOperationQueue.mainQueue())
self.requestSerializer = requestSerializer
self.responseSerializer = responseSerializer
}
deinit {
self.session.finishTasksAndInvalidate()
}
/**
Gateway to perform different http requests including multipart.
:param: url the url of the resource.
:param: parameters the request parameters.
:param: method the method to be used.
:param: completionHandler A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: The object created from the response data of request and the `NSError` object describing the network or parsing error that occurred.
*/
public func request(method: HttpMethod, path: String, parameters: [String: AnyObject]? = nil, credential: NSURLCredential? = nil, responseSerializer: ResponseSerializer? = nil, completionHandler: CompletionBlock) {
let block: () -> Void = {
let finalOptURL = self.calculateURL(self.baseURL, url: path)
guard let finalURL = finalOptURL else {
let error = NSError(domain: "AeroGearHttp", code: 0, userInfo: [NSLocalizedDescriptionKey: "Malformed URL"])
completionHandler(nil, error)
return
}
var request: NSURLRequest
var task: NSURLSessionTask?
var delegate: TaskDataDelegate
// care for multipart request is multipart data are set
if (self.hasMultiPartData(parameters)) {
request = self.requestSerializer.multipartRequest(finalURL, method: method, parameters: parameters, headers: self.authzModule?.authorizationFields())
task = self.session.uploadTaskWithStreamedRequest(request)
delegate = TaskUploadDelegate()
} else {
request = self.requestSerializer.request(finalURL, method: method, parameters: parameters, headers: self.authzModule?.authorizationFields())
task = self.session.dataTaskWithRequest(request);
delegate = TaskDataDelegate()
}
delegate.completionHandler = completionHandler
delegate.responseSerializer = responseSerializer == nil ? self.responseSerializer : responseSerializer
delegate.credential = credential
self.delegate[task] = delegate
if let task = task {task.resume()}
}
// cater for authz and pre-authorize prior to performing request
if (self.authzModule != nil) {
self.authzModule?.requestAccess({ (response, error ) in
// if there was an error during authz, no need to continue
if (error != nil) {
completionHandler(nil, error)
return
}
// ..otherwise proceed normally
block();
})
} else {
block()
}
}
/**
Gateway to perform different file requests either download or upload.
:param: url the url of the resource.
:param: parameters the request parameters.
:param: method the method to be used.
:param: responseSerializer the actual response serializer to use upon receiving a response
:param: type the file request type
:param: progress a block that will be invoked to report progress during either download or upload.
:param: completionHandler A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: The object created from the response data of request and the `NSError` object describing the network or parsing error that occurred.
*/
private func fileRequest(url: String, parameters: [String: AnyObject]? = nil, method: HttpMethod, credential: NSURLCredential? = nil, responseSerializer: ResponseSerializer? = nil, type: FileRequestType, progress: ProgressBlock?, completionHandler: CompletionBlock) {
let block: () -> Void = {
let finalOptURL = self.calculateURL(self.baseURL, url: url)
guard let finalURL = finalOptURL else {
let error = NSError(domain: "AeroGearHttp", code: 0, userInfo: [NSLocalizedDescriptionKey: "Malformed URL"])
completionHandler(nil, error)
return
}
var request: NSURLRequest
// care for multipart request is multipart data are set
if (self.hasMultiPartData(parameters)) {
request = self.requestSerializer.multipartRequest(finalURL, method: method, parameters: parameters, headers: self.authzModule?.authorizationFields())
} else {
request = self.requestSerializer.request(finalURL, method: method, parameters: parameters, headers: self.authzModule?.authorizationFields())
}
var task: NSURLSessionTask?
switch type {
case .Download(let destinationDirectory):
task = self.session.downloadTaskWithRequest(request)
let delegate = TaskDownloadDelegate()
delegate.downloadProgress = progress
delegate.destinationDirectory = destinationDirectory;
delegate.completionHandler = completionHandler
delegate.credential = credential
delegate.responseSerializer = responseSerializer == nil ? self.responseSerializer : responseSerializer
self.delegate[task] = delegate
case .Upload(let uploadType):
switch uploadType {
case .Data(let data):
task = self.session.uploadTaskWithRequest(request, fromData: data)
case .File(let url):
task = self.session.uploadTaskWithRequest(request, fromFile: url)
case .Stream(_):
task = self.session.uploadTaskWithStreamedRequest(request)
}
let delegate = TaskUploadDelegate()
delegate.uploadProgress = progress
delegate.completionHandler = completionHandler
delegate.credential = credential
delegate.responseSerializer = responseSerializer
self.delegate[task] = delegate
}
if let task = task {task.resume()}
}
// cater for authz and pre-authorize prior to performing request
if (self.authzModule != nil) {
self.authzModule?.requestAccess({ (response, error ) in
// if there was an error during authz, no need to continue
if (error != nil) {
completionHandler(nil, error)
return
}
// ..otherwise proceed normally
block();
})
} else {
block()
}
}
/**
Request to download a file.
:param: url the URL of the downloadable resource.
:param: destinationDirectory the destination directory where the file would be stored, if not specified. application's default '.Documents' directory would be used.
:param: parameters the request parameters.
:param: credential the credentials to use for basic/digest auth (Note: it is advised that HTTPS should be used by default).
:param: method the method to be used, by default a .GET request.
:param: progress a block that will be invoked to report progress during download.
:param: completionHandler a block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: The object created from the response data of request and the `NSError` object describing the network or parsing error that occurred.
*/
public func download(url: String, destinationDirectory: String? = nil, parameters: [String: AnyObject]? = nil, credential: NSURLCredential? = nil, method: HttpMethod = .GET, progress: ProgressBlock?, completionHandler: CompletionBlock) {
fileRequest(url, parameters: parameters, method: method, credential: credential, type: .Download(destinationDirectory), progress: progress, completionHandler: completionHandler)
}
/**
Request to upload a file using an NURL of a local file.
:param: url the URL to upload resource into.
:param: file the URL of the local file to be uploaded.
:param: parameters the request parameters.
:param: credential the credentials to use for basic/digest auth (Note: it is advised that HTTPS should be used by default).
:param: method the method to be used, by default a .POST request.
:param: responseSerializer the actual response serializer to use upon receiving a response.
:param: progress a block that will be invoked to report progress during upload.
:param: completionHandler A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: The object created from the response data of request and the `NSError` object describing the network or parsing error that occurred.
*/
public func upload(url: String, file: NSURL, parameters: [String: AnyObject]? = nil, credential: NSURLCredential? = nil, method: HttpMethod = .POST, responseSerializer: ResponseSerializer? = nil, progress: ProgressBlock?, completionHandler: CompletionBlock) {
fileRequest(url, parameters: parameters, method: method, credential: credential, responseSerializer: responseSerializer, type: .Upload(.File(file)), progress: progress, completionHandler: completionHandler)
}
/**
Request to upload a file using a raw NSData object.
:param: url the URL to upload resource into.
:param: data the data to be uploaded.
:param: parameters the request parameters.
:param: credential the credentials to use for basic/digest auth (Note: it is advised that HTTPS should be used by default).
:param: method the method to be used, by default a .POST request.
:param: responseSerializer the actual response serializer to use upon receiving a response.
:param: progress a block that will be invoked to report progress during upload.
:param: completionHandler A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: The object created from the response data of request and the `NSError` object describing the network or parsing error that occurred.
*/
public func upload(url: String, data: NSData, parameters: [String: AnyObject]? = nil, credential: NSURLCredential? = nil, method: HttpMethod = .POST, responseSerializer: ResponseSerializer? = nil, progress: ProgressBlock?, completionHandler: CompletionBlock) {
fileRequest(url, parameters: parameters, method: method, credential: credential, responseSerializer: responseSerializer, type: .Upload(.Data(data)), progress: progress, completionHandler: completionHandler)
}
/**
Request to upload a file using an NSInputStream object.
- parameter url: the URL to upload resource into.
- parameter stream: the stream that will be used for uploading.
- parameter parameters: the request parameters.
- parameter credential: the credentials to use for basic/digest auth (Note: it is advised that HTTPS should be used by default).
- parameter method: the method to be used, by default a .POST request.
- parameter responseSerializer: the actual response serializer to use upon receiving a response.
- parameter progress: a block that will be invoked to report progress during upload.
- parameter completionHandler: A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: The object created from the response data of request and the `NSError` object describing the network or parsing error that occurred.
*/
public func upload(url: String, stream: NSInputStream, parameters: [String: AnyObject]? = nil, credential: NSURLCredential? = nil, method: HttpMethod = .POST, responseSerializer: ResponseSerializer? = nil, progress: ProgressBlock?, completionHandler: CompletionBlock) {
fileRequest(url, parameters: parameters, method: method, credential: credential, responseSerializer: responseSerializer, type: .Upload(.Stream(stream)), progress: progress, completionHandler: completionHandler)
}
// MARK: Private API
// MARK: SessionDelegate
class SessionDelegate: NSObject, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate {
private var delegates: [Int: TaskDelegate]
private subscript(task: NSURLSessionTask?) -> TaskDelegate? {
get {
guard let task = task else {
return nil
}
return self.delegates[task.taskIdentifier]
}
set (newValue) {
guard let task = task else {
return
}
self.delegates[task.taskIdentifier] = newValue
}
}
required override init() {
self.delegates = Dictionary()
super.init()
}
func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) {
// TODO
}
func URLSession(session: NSURLSession, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) {
completionHandler(.PerformDefaultHandling, nil)
}
func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) {
// TODO
}
// MARK: NSURLSessionTaskDelegate
func URLSession(session: NSURLSession, task: NSURLSessionTask, willPerformHTTPRedirection response: NSHTTPURLResponse, newRequest request: NSURLRequest, completionHandler: (NSURLRequest?) -> Void) {
if let delegate = self[task] {
delegate.URLSession(session, task: task, willPerformHTTPRedirection: response, newRequest: request, completionHandler: completionHandler)
}
}
func URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) {
if let delegate = self[task] {
delegate.URLSession(session, task: task, didReceiveChallenge: challenge, completionHandler: completionHandler)
} else {
self.URLSession(session, didReceiveChallenge: challenge, completionHandler: completionHandler)
}
}
func URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStream completionHandler: (NSInputStream?) -> Void) {
if let delegate = self[task] {
delegate.URLSession(session, task: task, needNewBodyStream: completionHandler)
}
}
func URLSession(session: NSURLSession, task: NSURLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) {
if let delegate = self[task] as? TaskUploadDelegate {
delegate.URLSession(session, task: task, didSendBodyData: bytesSent, totalBytesSent: totalBytesSent, totalBytesExpectedToSend: totalBytesExpectedToSend)
}
}
func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
if let delegate = self[task] {
delegate.URLSession(session, task: task, didCompleteWithError: error)
self[task] = nil
}
}
// MARK: NSURLSessionDataDelegate
func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveResponse response: NSURLResponse, completionHandler: (NSURLSessionResponseDisposition) -> Void) {
completionHandler(.Allow)
}
func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) {
let downloadDelegate = TaskDownloadDelegate()
self[downloadTask] = downloadDelegate
}
func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
if let delegate = self[dataTask] as? TaskDataDelegate {
delegate.URLSession(session, dataTask: dataTask, didReceiveData: data)
}
}
func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, willCacheResponse proposedResponse: NSCachedURLResponse, completionHandler: (NSCachedURLResponse?) -> Void) {
completionHandler(proposedResponse)
}
// MARK: NSURLSessionDownloadDelegate
func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL location: NSURL) {
if let delegate = self[downloadTask] as? TaskDownloadDelegate {
delegate.URLSession(session, downloadTask: downloadTask, didFinishDownloadingToURL: location)
}
}
func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) {
if let delegate = self[downloadTask] as? TaskDownloadDelegate {
delegate.URLSession(session, downloadTask: downloadTask, didWriteData: bytesWritten, totalBytesWritten: totalBytesWritten, totalBytesExpectedToWrite: totalBytesExpectedToWrite)
}
}
func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) {
if let delegate = self[downloadTask] as? TaskDownloadDelegate {
delegate.URLSession(session, downloadTask: downloadTask, didResumeAtOffset: fileOffset, expectedTotalBytes: expectedTotalBytes)
}
}
}
// MARK: NSURLSessionTaskDelegate
class TaskDelegate: NSObject, NSURLSessionTaskDelegate {
var data: NSData? { return nil }
var completionHandler: ((AnyObject?, NSError?) -> Void)?
var responseSerializer: ResponseSerializer?
var credential: NSURLCredential?
func URLSession(session: NSURLSession, task: NSURLSessionTask, willPerformHTTPRedirection response: NSHTTPURLResponse, newRequest request: NSURLRequest, completionHandler: (NSURLRequest?) -> Void) {
completionHandler(request)
}
func URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) {
var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling
var credential: NSURLCredential?
if challenge.previousFailureCount > 0 {
disposition = .CancelAuthenticationChallenge
} else {
credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace)
if credential != nil {
disposition = .UseCredential
}
}
completionHandler(disposition, credential)
}
func URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStream completionHandler: ((NSInputStream?) -> Void)) {
}
func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
if error != nil {
completionHandler?(nil, error)
return
}
let response = task.response as! NSHTTPURLResponse
if let _ = task as? NSURLSessionDownloadTask {
completionHandler?(response, error)
return
}
var responseObject: AnyObject? = nil
do {
if let data = data {
try self.responseSerializer?.validateResponse(response, data)
responseObject = self.responseSerializer?.response(data, response.statusCode)
completionHandler?(responseObject, nil)
}
} catch let error as NSError {
var userInfo = error.userInfo
userInfo["StatusCode"] = response.statusCode
let errorToRethrow = NSError(domain: error.domain, code: error.code, userInfo: userInfo)
completionHandler?(responseObject, errorToRethrow)
}
}
}
// MARK: NSURLSessionDataDelegate
class TaskDataDelegate: TaskDelegate, NSURLSessionDataDelegate {
private var mutableData: NSMutableData
override var data: NSData? {
return self.mutableData
}
override init() {
self.mutableData = NSMutableData()
}
func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveResponse response: NSURLResponse, completionHandler: (NSURLSessionResponseDisposition) -> Void) {
completionHandler(.Allow)
}
func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
self.mutableData.appendData(data)
}
func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, willCacheResponse proposedResponse: NSCachedURLResponse, completionHandler: (NSCachedURLResponse?) -> Void) {
let cachedResponse = proposedResponse
completionHandler(cachedResponse)
}
}
// MARK: NSURLSessionDownloadDelegate
class TaskDownloadDelegate: TaskDelegate, NSURLSessionDownloadDelegate {
var downloadProgress: ((Int64, Int64, Int64) -> Void)?
var resumeData: NSData?
var destinationDirectory: NSString?
func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL location: NSURL) {
let filename = downloadTask.response?.suggestedFilename
// calculate final destination
var finalDestination: NSURL
if (destinationDirectory == nil) { // use 'default documents' directory if not set
// use default documents directory
let documentsDirectory = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] as NSURL
finalDestination = documentsDirectory.URLByAppendingPathComponent(filename!)
} else {
// check that the directory exists
let path = destinationDirectory?.stringByAppendingPathComponent(filename!)
finalDestination = NSURL(fileURLWithPath: path!)
}
do {
try NSFileManager.defaultManager().moveItemAtURL(location, toURL: finalDestination)
} catch _ {
}
}
func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) {
self.downloadProgress?(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite)
}
func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) {
}
}
// MARK: NSURLSessionTaskDelegate
class TaskUploadDelegate: TaskDataDelegate {
var uploadProgress: ((Int64, Int64, Int64) -> Void)?
func URLSession(session: NSURLSession, task: NSURLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) {
self.uploadProgress?(bytesSent, totalBytesSent, totalBytesExpectedToSend)
}
}
// MARK: Utility methods
public func calculateURL(baseURL: String?, var url: String) -> NSURL? {
if (baseURL == nil || url.hasPrefix("http")) {
return NSURL(string: url)!
}
guard let finalURL = NSURL(string: baseURL!) else {return nil}
if (url.hasPrefix("/")) {
url = url.substringFromIndex(url.startIndex.advancedBy(1))
}
return finalURL.URLByAppendingPathComponent(url);
}
public func hasMultiPartData(parameters: [String: AnyObject]?) -> Bool {
if (parameters == nil) {
return false
}
var isMultiPart = false
for (_, value) in parameters! {
if value is MultiPartData {
isMultiPart = true
break
}
}
return isMultiPart
}
}

View File

@ -0,0 +1,219 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
An HttpRequest serializer that handles form-encoded URL requess including multipart support.
*/
public class HttpRequestSerializer: RequestSerializer {
/// The url that this request serializer is bound to.
public var url: NSURL?
/// Any headers that will be appended on the request.
public var headers: [String: String]?
/// The String encoding to be used.
public var stringEncoding: NSNumber
/// The cache policy.
public var cachePolicy: NSURLRequestCachePolicy
/// The timeout interval.
public var timeoutInterval: NSTimeInterval
/// Defualt initializer.
public init() {
self.stringEncoding = NSUTF8StringEncoding
self.timeoutInterval = 60
self.cachePolicy = .UseProtocolCachePolicy
}
/**
Build an request using the specified params passed in.
:param: url the url of the resource.
:param: method the method to be used.
:param: parameters the request parameters.
:param: headers any headers to be used on this request.
:returns: the URLRequest object.
*/
public func request(url: NSURL, method: HttpMethod, parameters: [String: AnyObject]?, headers: [String: String]? = nil) -> NSURLRequest {
let request = NSMutableURLRequest(URL: url, cachePolicy: cachePolicy, timeoutInterval: timeoutInterval)
request.HTTPMethod = method.rawValue
// apply headers to new request
if(headers != nil) {
for (key,val) in headers! {
request.addValue(val, forHTTPHeaderField: key)
}
}
if method == HttpMethod.GET || method == HttpMethod.HEAD || method == HttpMethod.DELETE {
let paramSeparator = request.URL?.query != nil ? "&" : "?"
var newUrl:String
if (request.URL?.absoluteString != nil && parameters != nil) {
let queryString = self.stringFromParameters(parameters!)
newUrl = "\(request.URL!.absoluteString)\(paramSeparator)\(queryString)"
request.URL = NSURL(string: newUrl)!
}
} else {
// set type
request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
// set body
if (parameters != nil) {
let body = self.stringFromParameters(parameters!).dataUsingEncoding(NSUTF8StringEncoding)
request.setValue("\(body?.length)", forHTTPHeaderField: "Content-Length")
request.HTTPBody = body
}
}
return request
}
/**
Build an multipart request using the specified params passed in.
:param: url the url of the resource.
:param: method the method to be used.
:param: parameters the request parameters.
:param: headers any headers to be used on this request.
:returns: the URLRequest object
*/
public func multipartRequest(url: NSURL, method: HttpMethod, parameters: [String: AnyObject]?, headers: [String: String]? = nil) -> NSURLRequest {
let request = NSMutableURLRequest(URL: url, cachePolicy: cachePolicy, timeoutInterval: timeoutInterval)
request.HTTPMethod = method.rawValue
// apply headers to new request
if(headers != nil) {
for (key,val) in headers! {
request.addValue(val, forHTTPHeaderField: key)
}
}
let boundary = "AG-boundary-\(arc4random())-\(arc4random())"
let type = "multipart/form-data; boundary=\(boundary)"
let body = self.multiPartBodyFromParams(parameters!, boundary: boundary)
request.setValue(type, forHTTPHeaderField: "Content-Type")
request.setValue("\(body.length)", forHTTPHeaderField: "Content-Length")
request.HTTPBody = body
return request
}
public func stringFromParameters(parameters: [String: AnyObject]) -> String {
let parametersArray = serialize((nil, parameters)).map({(tuple) in
return self.stringValue(tuple)
})
return parametersArray.joinWithSeparator("&")
// return "&".join(serialize((nil, parameters)).map({(tuple) in
// return self.stringValue(tuple)
// }))
}
public func serialize(tuple: (String?, AnyObject)) -> [(String?, AnyObject)] {
var collect:[(String?, AnyObject)] = []
if let array = tuple.1 as? [AnyObject] {
for nestedValue : AnyObject in array {
let label: String = tuple.0!
let myTuple:(String?, AnyObject) = (label + "[]", nestedValue)
collect.appendContentsOf(self.serialize(myTuple))
}
} else if let dict = tuple.1 as? [String: AnyObject] {
for (nestedKey, nestedObject) in dict {
let newKey = tuple.0 != nil ? "\(tuple.0!)[\(nestedKey)]" : nestedKey
let myTuple:(String?, AnyObject) = (newKey, nestedObject)
collect.appendContentsOf(self.serialize(myTuple))
}
} else {
collect.append((tuple.0, tuple.1))
}
return collect
}
public func stringValue(tuple: (String?, AnyObject)) -> String {
var val = ""
if let str = tuple.1 as? String {
val = str
} else if tuple.1.description != nil {
val = tuple.1.description
}
if tuple.0 == nil {
return val.urlEncode()
}
return "\(tuple.0!.urlEncode())=\(val.urlEncode())"
}
public func multiPartBodyFromParams(parameters: [String: AnyObject], boundary: String) -> NSData {
let data = NSMutableData()
let prefixData = "--\(boundary)\r\n".dataUsingEncoding(NSUTF8StringEncoding)
let seperData = "\r\n".dataUsingEncoding(NSUTF8StringEncoding)
for (key, value) in parameters {
var sectionData: NSData?
var sectionType: String?
var sectionFilename = ""
if value is MultiPartData {
let multiData = value as! MultiPartData
sectionData = multiData.data
sectionType = multiData.mimeType
sectionFilename = " filename=\"\(multiData.filename)\""
} else {
sectionData = "\(value)".dataUsingEncoding(NSUTF8StringEncoding)
}
data.appendData(prefixData!)
let sectionDisposition = "Content-Disposition: form-data; name=\"\(key)\";\(sectionFilename)\r\n".dataUsingEncoding(NSUTF8StringEncoding)
data.appendData(sectionDisposition!)
if let type = sectionType {
let contentType = "Content-Type: \(type)\r\n".dataUsingEncoding(NSUTF8StringEncoding)
data.appendData(contentType!)
}
// append data
data.appendData(seperData!)
data.appendData(sectionData!)
data.appendData(seperData!)
}
data.appendData("--\(boundary)--\r\n".dataUsingEncoding(NSUTF8StringEncoding)!)
return data
}
public func hasMultiPartData(parameters: [String: AnyObject]?) -> Bool {
if (parameters == nil) {
return false
}
var isMultiPart = false
for (_, value) in parameters! {
if value is MultiPartData {
isMultiPart = true
break
}
}
return isMultiPart
}
}

View File

@ -0,0 +1,68 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
A request serializer to JSON objects/
*/
public class JsonRequestSerializer: HttpRequestSerializer {
/**
Build an request using the specified params passed in.
:param: url the url of the resource.
:param: method the method to be used.
:param: parameters the request parameters.
:param: headers any headers to be used on this request.
:returns: the URLRequest object.
*/
public override func request(url: NSURL, method: HttpMethod, parameters: [String: AnyObject]?, headers: [String: String]? = nil) -> NSURLRequest {
if method == HttpMethod.GET || method == HttpMethod.HEAD || method == HttpMethod.DELETE {
return super.request(url, method: method, parameters: parameters, headers: headers)
} else {
let request = NSMutableURLRequest(URL: url, cachePolicy: cachePolicy, timeoutInterval: timeoutInterval)
request.HTTPMethod = method.rawValue
// set type
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
// set body
if (parameters != nil) {
var body: NSData?
do {
body = try NSJSONSerialization.dataWithJSONObject(parameters!, options: [])
} catch _ {
body = nil
}
// set body
if (body != nil) {
request.setValue("\(body?.length)", forHTTPHeaderField: "Content-Length")
request.HTTPBody = body
}
}
// apply headers to new request
if(headers != nil) {
for (key,val) in headers! {
request.addValue(val, forHTTPHeaderField: key)
}
}
return request
}
}
}

View File

@ -0,0 +1,84 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
A response deserializer to JSON objects.
*/
public class JsonResponseSerializer : ResponseSerializer {
/**
Validate the response received. throw an error is the response is not va;id.
:returns: either true or false if the response is valid for this particular serializer.
*/
public var validateResponse: (NSURLResponse!, NSData) throws -> Void = { (response: NSURLResponse!, data: NSData) -> Void in
var error: NSError! = NSError(domain: "AeroGearHttp", code: 0, userInfo: nil)
let httpResponse = response as! NSHTTPURLResponse
let dataAsJson: [String: AnyObject]?
// validate JSON
do {
dataAsJson = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions(rawValue: 0)) as? [String: AnyObject]
} catch _ {
let userInfo = [NSLocalizedDescriptionKey: "Invalid response received, can't parse JSON" as NSString,
NetworkingOperationFailingURLResponseErrorKey: response]
let customError = NSError(domain: HttpResponseSerializationErrorDomain, code: NSURLErrorBadServerResponse, userInfo: userInfo)
throw customError;
}
if !(httpResponse.statusCode >= 200 && httpResponse.statusCode < 300) {
var userInfo = [NSLocalizedDescriptionKey: NSHTTPURLResponse.localizedStringForStatusCode(httpResponse.statusCode),
NetworkingOperationFailingURLResponseErrorKey: response]
if let dataAsJson = dataAsJson {
userInfo["CustomData"] = dataAsJson
}
error = NSError(domain: HttpResponseSerializationErrorDomain, code: httpResponse.statusCode, userInfo: userInfo)
throw error
}
}
/**
Deserialize the response received.
:returns: the serialized response
*/
public var response: (NSData, Int) -> AnyObject? = { (data: NSData, Int) -> AnyObject? in
do {
return try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions(rawValue: 0))
} catch _ {
return nil
}
}
public init() {
}
public init(validateResponse: (NSURLResponse!, NSData) throws -> Void, response: (NSData, Int) -> AnyObject?) {
self.validateResponse = validateResponse
self.response = response
}
public init(validateResponse: (NSURLResponse!, NSData) throws -> Void) {
self.validateResponse = validateResponse
}
public init(response: (NSData, Int) -> AnyObject?) {
self.response = response
}
}

View File

@ -0,0 +1,66 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
Represents a multipart object containing a file plus metadata to be processed during upload.
*/
public class MultiPartData {
/// The 'name' to be used on the request.
public var name: String
/// The 'filename' to be used on the request.
public var filename: String
/// The 'MIME type' to be used on the request.
public var mimeType: String
/// The actual data to be sent.
public var data: NSData
/**
Initialize a multipart object using an NSURL and a corresponding MIME type.
:param: url the url of the local file.
:param: mimeType the MIME type.
:returns: the newly created multipart data.
*/
public init(url: NSURL, mimeType: String) {
self.name = url.lastPathComponent!
self.filename = url.lastPathComponent!
self.mimeType = mimeType;
self.data = NSData(contentsOfURL: url)!
}
/**
Initialize a multipart object using an NSData plus metadata.
:param: data the actual data to be uploaded.
:param: name the 'name' to be used on the request.
:param: filename the 'filename' to be used on the request.
:param: mimeType the 'MIME type' to be used on the request.
:returns: the newly created multipart data.
*/
public init(data: NSData, name: String, filename: String, mimeType: String) {
self.data = data;
self.name = name;
self.filename = filename;
self.mimeType = mimeType;
}
}

View File

@ -0,0 +1,59 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
The protocol that request serializers must adhere to.
*/
public protocol RequestSerializer {
/// The url that this request serializer is bound to.
var url: NSURL? { get set }
/// Any headers that will be appended on the request.
var headers: [String: String]? { get set }
/// The String encoding to be used.
var stringEncoding: NSNumber { get }
/// The cache policy.
var cachePolicy: NSURLRequestCachePolicy { get }
/// The timeout interval.
var timeoutInterval: NSTimeInterval { get set }
/**
Build an request using the specified params passed in.
:param: url the url of the resource.
:param: method the method to be used.
:param: parameters the request parameters.
:param: headers any headers to be used on this request.
:returns: the URLRequest object.
*/
func request(url: NSURL, method: HttpMethod, parameters: [String: AnyObject]?, headers: [String: String]?) -> NSURLRequest
/**
Build an multipart request using the specified params passed in.
:param: url the url of the resource.
:param: method the method to be used.
:param: parameters the request parameters.
:param: headers any headers to be used on this request.
:returns: the URLRequest object
*/
func multipartRequest(url: NSURL, method: HttpMethod, parameters: [String: AnyObject]?, headers: [String: String]?) -> NSURLRequest
}

View File

@ -0,0 +1,43 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
Error domain for serializers.
*/
public let HttpResponseSerializationErrorDomain = "ResponseSerializerDomain"
/**
The protocol that response serializers must adhere to.
*/
public protocol ResponseSerializer {
/**
Deserialize the response received.
:returns: the serialized response
*/
var response: (NSData, Int) -> AnyObject? {get set}
/**
Validate the response received. This is a cutomizable closure variable.
:returns: either true or false if the response is valid for this particular serializer.
*/
var validateResponse: (NSURLResponse!, NSData) throws -> Void {get set}
}

View File

@ -0,0 +1,70 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
A response deserializer to a generic String object.
*/
public class StringResponseSerializer : ResponseSerializer {
/**
Deserialize the response received.
:returns: the serialized response
*/
public var response: (NSData, Int) -> AnyObject? = {(data: NSData, status: Int) -> (AnyObject?) in
return NSString(data: data, encoding:NSUTF8StringEncoding)
}
/**
Validate the response received.
:returns: either true or false if the response is valid for this particular serializer.
*/
public var validateResponse: (NSURLResponse!, NSData) throws -> Void = { (response: NSURLResponse!, data: NSData) throws in
var error: NSError! = NSError(domain: "Migrator", code: 0, userInfo: nil)
let httpResponse = response as! NSHTTPURLResponse
if !(httpResponse.statusCode >= 200 && httpResponse.statusCode < 300) {
let userInfo = [
NSLocalizedDescriptionKey: NSHTTPURLResponse.localizedStringForStatusCode(httpResponse.statusCode),
NetworkingOperationFailingURLResponseErrorKey: response]
if (true) {
error = NSError(domain: HttpResponseSerializationErrorDomain, code: httpResponse.statusCode, userInfo: userInfo)
}
throw error
}
}
public init() {
}
public init(validateResponse: (NSURLResponse!, NSData) throws -> Void, response: (NSData, Int) -> AnyObject?) {
self.validateResponse = validateResponse
self.response = response
}
public init(validateResponse: (NSURLResponse!, NSData) throws -> Void) {
self.validateResponse = validateResponse
}
public init(response: (NSData, Int) -> AnyObject?) {
self.response = response
}
}

View File

@ -0,0 +1,33 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
Handy extensions and utilities.
*/
extension String {
public func urlEncode() -> String {
let encodedURL = CFURLCreateStringByAddingPercentEscapes(nil,
self as NSString,
nil,
"!@#$%&*'();:=+,/?[]",
CFStringBuiltInEncodings.UTF8.rawValue)
return encodedURL as String
}
}

202
Pods/AeroGearHttp/LICENSE.txt generated Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

160
Pods/AeroGearHttp/README.md generated Normal file
View File

@ -0,0 +1,160 @@
# aerogear-ios-http [![Build Status](https://travis-ci.org/aerogear/aerogear-ios-http.png)](https://travis-ci.org/aerogear/aerogear-ios-http)
> This module currently build with Xcode 7.2 and supports iOS8, iOS9.
Thin layer to take care of your http requests working with NSURLSession.
Taking care of:
* Json serializer
* Multipart upload
* HTTP Basic/Digest authentication support
* Pluggable object serialization
* background processing support
100% Swift 2.0.
| | Project Info |
| --------------- | ------------- |
| License: | Apache License, Version 2.0 |
| Build: | CocoaPods |
| Documentation: | http://aerogear.org/ios/ |
| Issue tracker: | https://issues.jboss.org/browse/AGIOS |
| Mailing lists: | [aerogear-users](http://aerogear-users.1116366.n5.nabble.com/) ([subscribe](https://lists.jboss.org/mailman/listinfo/aerogear-users)) |
| | [aerogear-dev](http://aerogear-dev.1069024.n5.nabble.com/) ([subscribe](https://lists.jboss.org/mailman/listinfo/aerogear-dev)) |
## Example Usage
To perform an HTTP request use the convenient methods found in the Http object. Here is an example usage:
```swift
let http = Http(baseURL: "http://server.com")
http.request(.GET, path: "/get", completionHandler: {(response, error) in
// handle response
})
http.request(.POST, path: "/post", parameters: ["key": "value"],
completionHandler: {(response, error) in
// handle response
})
...
```
### Authentication
The library also leverages the build-in foundation support for http/digest authentication and exposes a convenient interface by allowing the credential object to be passed on the request. Here is an example:
> **NOTE:** It is advised that HTTPS should be used when performing authentication of this type
```swift
let credential = NSURLCredential(user: "john",
password: "pass",
persistence: .None)
http.request(.GET, path: "/protected/endpoint", credential: credential,
completionHandler: {(response, error) in
// handle response
})
```
You can also set a credential per protection space, so it's automatically picked up once http challenge is requested by the server, thus omitting the need to pass the credential on each request. In this case, you must initialize the ```Http``` object with a custom session configuration object, that has its credentials storage initialized with your credentials:
```swift
// create a protection space
var protectionSpace = NSURLProtectionSpace(host: "httpbin.org",
port: 443,
protocol: NSURLProtectionSpaceHTTPS,
realm: "me@kennethreitz.com",
authenticationMethod: NSURLAuthenticationMethodHTTPDigest)
// setup credential
// notice that we use '.ForSession' type otherwise credential storage will discard and
// won't save it when doing 'credentialStorage.setDefaultCredential' later on
let credential = NSURLCredential(user: user,
password: password,
persistence: .ForSession)
// assign it to credential storage
var credentialStorage = NSURLCredentialStorage.sharedCredentialStorage()
credentialStorage.setDefaultCredential(credential, forProtectionSpace: protectionSpace);
// set up default configuration and assign credential storage
var configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
configuration.URLCredentialStorage = credentialStorage
// assign custom configuration to Http
var http = Http(baseURL: "http://httpbin.org", sessionConfig: configuration)
http.request(.GET, path: "/protected/endpoint", completionHandler: {(response, error) in
// handle response
})
```
### OAuth2 Protocol Support
To support the OAuth2 protocol, we have created a separate library [aerogear-ios-oauth2](https://github.com/aerogear/aerogear-ios-oauth2) that can be easily integrated, in order to provide out-of-the-box support for communicated with OAuth2 protected endpoints. Please have a look at the "Http and OAuth2Module" section on our [documentation page](http://aerogear.org/docs/guides/aerogear-ios-2.X/Authorization/) for more information.
Do you want to try it on your end? Follow next section steps.
### Build, test and play with aerogear-ios-http
1. Clone this project
2. Get the dependencies
The project uses [OHHTTPStubs](https://github.com/AliSoftware/OHHTTPStubs) framework for stubbing its http network requests and utilizes [cocoapods](http://cocoapods.org) 0.36 release for handling its dependencies. As a pre-requisite, install [cocoapods](http://blog.cocoapods.org/CocoaPods-0.36/) and then install the pod. On the root directory of the project run:
```bash
pod install
```
3. open AeroGearHttp.xcworkspace
## Adding the library to your project
To add the library in your project, you can either use [CocoaPods](http://cocoapods.org) or manual install in your project. See the respective sections below for instructions:
### Using [CocoaPods](http://cocoapods.org)
Support for Swift frameworks is supported from [CocoaPods-0.36 release](http://blog.cocoapods.org/CocoaPods-0.36/) upwards. In your ```Podfile``` add:
```
pod 'AeroGearHttp'
```
and then:
```bash
pod install
```
to install your dependencies
### Manual Installation
Follow these steps to add the library in your Swift project:
1. Add AeroGearHttp as a [submodule](http://git-scm.com/docs/git-submodule) in your project. Open a terminal and navigate to your project directory. Then enter:
```bash
git submodule add https://github.com/aerogear/aerogear-ios-http.git
```
2. Open the `aerogear-ios-http` folder, and drag the `AeroGearHttp.xcodeproj` into the file navigator in Xcode.
3. In Xcode select your application target and under the "Targets" heading section, ensure that the 'iOS Deployment Target' matches the application target of AeroGearHttp.framework (Currently set to 8.0).
5. Select the "Build Phases" heading section, expand the "Target Dependencies" group and add `AeroGearHttp.framework`.
7. Click on the `+` button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add `AeroGearHttp.framework`.
If you run into any problems, please [file an issue](http://issues.jboss.org/browse/AEROGEAR) and/or ask our [user mailing list](https://lists.jboss.org/mailman/listinfo/aerogear-users). You can also join our [dev mailing list](https://lists.jboss.org/mailman/listinfo/aerogear-dev).
## Documentation
For more details about the current release, please consult [our documentation](http://aerogear.org/ios/).
## Development
If you would like to help develop AeroGear you can join our [developer's mailing list](https://lists.jboss.org/mailman/listinfo/aerogear-dev), join #aerogear on Freenode, or shout at us on Twitter @aerogears.
Also takes some time and skim the [contributor guide](http://aerogear.org/docs/guides/Contributing/)
## Questions?
Join our [user mailing list](https://lists.jboss.org/mailman/listinfo/aerogear-users) for any questions or help! We really hope you enjoy app development with AeroGear!
## Found a bug?
If you found a bug please create a ticket for us on [Jira](https://issues.jboss.org/browse/AGIOS) with some steps to reproduce it.

View File

@ -0,0 +1,239 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
A Config object that setups facebook specific configuration parameters.
*/
public class FacebookConfig: Config {
/**
Init a Facebook configuration.
:param: clientId OAuth2 credentials an unique string that is generated in the OAuth2 provider Developers Console.
:param: clientSecret OAuth2 credentials an unique string that is generated in the OAuth2 provider Developers Console.
:param: scopes an array of scopes the app is asking access to.
:param: accountId this unique id is used by AccountManager to identify the OAuth2 client.
:paream: isOpenIDConnect to identify if fetching id information is required.
*/
public init(clientId: String, clientSecret: String, scopes: [String], accountId: String? = nil, isOpenIDConnect: Bool = false) {
super.init(base: "",
authzEndpoint: "https://www.facebook.com/dialog/oauth",
redirectURL: "fb\(clientId)://authorize/",
accessTokenEndpoint: "https://graph.facebook.com/oauth/access_token",
clientId: clientId,
refreshTokenEndpoint: "https://graph.facebook.com/oauth/access_token",
clientSecret: clientSecret,
revokeTokenEndpoint: "https://www.facebook.com/me/permissions",
isOpenIDConnect: isOpenIDConnect,
userInfoEndpoint: isOpenIDConnect ? "https://graph.facebook.com/v2.2/me" : nil,
scopes: scopes,
accountId: accountId)
// Add openIdConnect scope
if self.isOpenIDConnect {
if self.scopes[0].rangeOfString("public_profile") == nil {
self.scopes[0] = self.scopes[0] + ", public_profile"
}
}
}
}
/**
A Config object that setups Google specific configuration parameters.
*/
public class GoogleConfig: Config {
/**
Init a Google configuration.
:param: clientId OAuth2 credentials an unique string that is generated in the OAuth2 provider Developers Console.
:param: scopes an array of scopes the app is asking access to.
:param: accountId this unique id is used by AccountManager to identify the OAuth2 client.
:paream: isOpenIDConnect to identify if fetching id information is required.
*/
public init(clientId: String, scopes: [String], accountId: String? = nil, isOpenIDConnect: Bool = false) {
let bundleString = NSBundle.mainBundle().bundleIdentifier ?? "google"
super.init(base: "https://accounts.google.com",
authzEndpoint: "o/oauth2/auth",
redirectURL: "\(bundleString):/oauth2Callback",
accessTokenEndpoint: "o/oauth2/token",
clientId: clientId,
refreshTokenEndpoint: "o/oauth2/token",
revokeTokenEndpoint: "rest/revoke",
isOpenIDConnect: isOpenIDConnect,
userInfoEndpoint: isOpenIDConnect ? "https://www.googleapis.com/plus/v1/people/me/openIdConnect" : nil,
scopes: scopes,
accountId: accountId)
// Add openIdConnect scope
if self.isOpenIDConnect {
self.scopes += ["openid", "email", "profile"]
}
}
}
/**
A Config object that setups Keycloak specific configuration parameters.
*/
public class KeycloakConfig: Config {
/**
Init a Keycloak configuration.
:param: clientId OAuth2 credentials an unique string that is generated in the OAuth2 provider Developers Console.
:param: host to identify where is the keycloak server located.
:param: realm to identify which realm to use. A realm grup a set of application/oauth2 client together.
:paream: isOpenIDConnect to identify if fetching id information is required.
*/
public init(clientId: String, host: String, realm: String? = nil, isOpenIDConnect: Bool = false) {
let bundleString = NSBundle.mainBundle().bundleIdentifier ?? "keycloak"
let defaulRealmName = String(format: "%@-realm", clientId)
let realm = realm ?? defaulRealmName
super.init(base: String(format: "%@/auth", host),
authzEndpoint: String(format: "realms/%@/tokens/login", realm),
redirectURL: "\(bundleString)://oauth2Callback",
accessTokenEndpoint: String(format: "realms/%@/tokens/access/codes", realm),
clientId: clientId,
refreshTokenEndpoint: String(format: "realms/%@/tokens/refresh", realm),
revokeTokenEndpoint: String(format: "realms/%@/tokens/logout", realm),
isOpenIDConnect: isOpenIDConnect)
// Add openIdConnect scope
if self.isOpenIDConnect {
self.scopes += ["openid", "email", "profile"]
}
}
}
/**
An account manager used to instantiate, store and retrieve OAuth2 modules.
*/
public class AccountManager {
/// List of OAuth2 modules available for a given app. Each module is linked to an OAuht2Session which securely store the tokens.
var modules: [String: OAuth2Module]
init() {
self.modules = [String: OAuth2Module]()
}
/// access a shared instance of an account manager
public class var sharedInstance: AccountManager {
struct Singleton {
static let instance = AccountManager()
}
return Singleton.instance
}
/**
Instantiate an OAuth2 Module using the configuration object passed in and adds it to the account manager. It uses the OAuth2Session account_id as the name that this module will be stored in.
:param: config the configuration object to use to setup an OAuth2 module.
:param: moduleClass the type of the OAuth2 module to instantiate.
:returns: the OAuth2 module
*/
public class func addAccount(config: Config, moduleClass: OAuth2Module.Type) -> OAuth2Module {
var myModule:OAuth2Module
myModule = moduleClass.init(config: config)
// TODO check accountId is unique in modules list
sharedInstance.modules[myModule.oauth2Session.accountId] = myModule
return myModule
}
/**
Removes an OAuth2 module
:param: name the name that the OAuth2 module was bound to.
:param: config the configuration object to use to setup an OAuth2 module.
:param: moduleClass the type of the OAuth2 module to instantiate.
:returns: the OAuth2module or nil if not found
*/
public class func removeAccount(name: String, config: Config, moduleClass: OAuth2Module.Type) -> OAuth2Module? {
return sharedInstance.modules.removeValueForKey(name)
}
/**
Retrieves an OAuth2 module by a name
:param: name the name that the OAuth2 module was bound to.
:returns: the OAuth2module or nil if not found.
*/
public class func getAccountByName(name: String) -> OAuth2Module? {
return sharedInstance.modules[name]
}
/**
Retrieves a list of OAuth2 modules bound to specific clientId.
:param: clientId the client it that the oauth2 module was bound to.
:returns: the OAuth2module or nil if not found.
*/
public class func getAccountsByClienId(clientId: String) -> [OAuth2Module] {
let modules: [OAuth2Module] = [OAuth2Module](sharedInstance.modules.values)
return modules.filter {$0.config.clientId == clientId }
}
/**
Retrieves an OAuth2 module by using a configuration object.
:param: config the Config object that this oauth2 module was used to instantiate.
:returns: the OAuth2module or nil if not found.
*/
public class func getAccountByConfig(config: Config) -> OAuth2Module? {
if config.accountId != nil {
return sharedInstance.modules[config.accountId!]
} else {
let modules = getAccountsByClienId(config.clientId)
if modules.count > 0 {
return modules[0]
} else {
return nil
}
}
}
/**
Convenient method to retrieve a Facebook oauth2 module.
:param: config a Facebook configuration object. See FacebookConfig.
:returns: a Facebook OAuth2 module.
*/
public class func addFacebookAccount(config: FacebookConfig) -> FacebookOAuth2Module {
return addAccount(config, moduleClass: FacebookOAuth2Module.self) as! FacebookOAuth2Module
}
/**
Convenient method to retrieve a Google oauth2 module ready to be used.
:param: config a google configuration object. See GoogleConfig.
:returns: a google OAuth2 module.
*/
public class func addGoogleAccount(config: GoogleConfig) -> OAuth2Module {
return addAccount(config, moduleClass: OAuth2Module.self)
}
/**
Convenient method to retrieve a Keycloak oauth2 module ready to be used.
:param: config a Keycloak configuration object. See KeycloakConfig.
:returns: a Keycloak OAuth2 module.
*/
public class func addKeycloakAccount(config: KeycloakConfig) -> KeycloakOAuth2Module {
return addAccount(config, moduleClass: KeycloakOAuth2Module.self) as! KeycloakOAuth2Module
}
}

View File

@ -0,0 +1,121 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
Configuration object to setup an OAuth2 module
*/
public class Config {
/**
Applies the baseURL to the configuration.
*/
public let baseURL: String
/**
Applies the "callback URL" once request token issued.
*/
public let redirectURL: String
/**
Applies the "authorization endpoint" to the request token.
*/
public var authzEndpoint: String
/**
Applies the "access token endpoint" to the exchange code for access token.
*/
public var accessTokenEndpoint: String
/**
Endpoint for request to invalidate both accessToken and refreshToken.
*/
public let revokeTokenEndpoint: String?
/**
Endpoint for request a refreshToken.
*/
public let refreshTokenEndpoint: String?
/**
Endpoint for OpenID Connect to get user information.
*/
public let userInfoEndpoint: String?
/**
Boolean to indicate whether OpenID Connect on authorization code grant flow is used.
*/
public var isOpenIDConnect: Bool
/**
Applies the various scopes of the authorization.
*/
public var scopes: [String]
var scope: String {
get {
// Create a string to concatenate all scopes existing in the _scopes array.
var scopeString = ""
for scope in self.scopes {
scopeString += scope.urlEncode()
// If the current scope is other than the last one, then add the "+" sign to the string to separate the scopes.
if (scope != self.scopes.last) {
scopeString += "+"
}
}
return scopeString
}
}
/**
Applies the "client id" obtained with the client registration process.
*/
public let clientId: String
/**
Applies the "client secret" obtained with the client registration process.
*/
public let clientSecret: String?
/**
Account id is used with AccountManager to store tokens. AccountId is defined by the end-user
and can be any String. If AccountManager is not used, this field is optional.
*/
public var accountId: String?
/**
Boolean to indicate to either used a webview (if true) or an external browser (by default, false)
for authorization code grant flow.
*/
public var isWebView: Bool = false
public init(base: String, authzEndpoint: String, redirectURL: String, accessTokenEndpoint: String, clientId: String, refreshTokenEndpoint: String? = nil, revokeTokenEndpoint: String? = nil, isOpenIDConnect:Bool = false, userInfoEndpoint: String? = nil, scopes: [String] = [], clientSecret: String? = nil, accountId: String? = nil, isWebView: Bool = false) {
self.baseURL = base
self.authzEndpoint = authzEndpoint
self.redirectURL = redirectURL
self.accessTokenEndpoint = accessTokenEndpoint
self.refreshTokenEndpoint = refreshTokenEndpoint
self.revokeTokenEndpoint = revokeTokenEndpoint
self.isOpenIDConnect = isOpenIDConnect ?? false
self.userInfoEndpoint = userInfoEndpoint
self.scopes = scopes
self.clientId = clientId
self.clientSecret = clientSecret
self.accountId = accountId
self.isWebView = isWebView
}
}

View File

@ -0,0 +1,55 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
Handy extensions to NSDate
*/
extension NSDate
{
/**
Initialize a date object using the given string.
:param: dateString the string that will be used to instantiate the date object. The string is expected to be in the format 'yyyy-MM-dd hh:mm:ss a'.
:returns: the NSDate object.
*/
public convenience init(dateString:String) {
let dateStringFormatter = NSDateFormatter()
dateStringFormatter.dateFormat = "yyyy-MM-dd hh:mm:ss a"
let d = dateStringFormatter.dateFromString(dateString)
if let unwrappedDate = d {
self.init(timeInterval:0, sinceDate:unwrappedDate)
} else {
self.init()
}
}
/**
Returns a string of the date object using the format 'yyyy-MM-dd hh:mm:ss a'.
:returns: a formatted string object.
*/
public func toString() -> String {
let dateStringFormatter = NSDateFormatter()
dateStringFormatter.dateFormat = "yyyy-MM-dd hh:mm:ss a"
return dateStringFormatter.stringFromDate(self)
}
}

View File

@ -0,0 +1,135 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
import AeroGearHttp
/**
An OAuth2Module subclass specific to 'Facebook' authorization
*/
public class FacebookOAuth2Module: OAuth2Module {
public required init(config: Config, session: OAuth2Session?, requestSerializer: RequestSerializer, responseSerializer: ResponseSerializer) {
super.init(config: config, session: session, requestSerializer: JsonRequestSerializer(), responseSerializer: StringResponseSerializer())
}
/**
Exchange an authorization code for an access token.
:param: code the 'authorization' code to exchange for an access token.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
override public func exchangeAuthorizationCodeForAccessToken(code: String, completionHandler: (AnyObject?, NSError?) -> Void) {
var paramDict: [String: String] = ["code": code, "client_id": config.clientId, "redirect_uri": config.redirectURL, "grant_type":"authorization_code"]
if let unwrapped = config.clientSecret {
paramDict["client_secret"] = unwrapped
}
http.request(.POST, path: config.accessTokenEndpoint, parameters: paramDict, completionHandler: { (response, error) in
if (error != nil) {
completionHandler(nil, error)
return
}
if let unwrappedResponse = response as? String {
var accessToken: String? = nil
var expiredIn: String? = nil
let charSet: NSMutableCharacterSet = NSMutableCharacterSet()
charSet.addCharactersInString("&=")
let array = unwrappedResponse.componentsSeparatedByCharactersInSet(charSet)
for (index, elt) in array.enumerate() {
if elt == "access_token" {
accessToken = array[index+1]
}
}
for (index, elt) in array.enumerate() {
if elt == "expires" {
expiredIn = array[index+1]
}
}
self.oauth2Session.saveAccessToken(accessToken, refreshToken: nil, accessTokenExpiration: expiredIn, refreshTokenExpiration: nil)
completionHandler(accessToken, nil)
}
})
}
/**
Request to revoke access.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
override public func revokeAccess(completionHandler: (AnyObject?, NSError?) -> Void) {
// return if not yet initialized
if (self.oauth2Session.accessToken == nil) {
return;
}
let paramDict:[String:String] = ["access_token":self.oauth2Session.accessToken!]
http.request(.DELETE, path: config.revokeTokenEndpoint!, parameters: paramDict, completionHandler: { (response, error) in
if (error != nil) {
completionHandler(nil, error)
return
}
self.oauth2Session.clearTokens()
completionHandler(response!, nil)
})
}
/**
Gateway to request authorization access
:param: completionHandler A block object to be executed when the request operation finishes.
*/
override public func login(completionHandler: (AnyObject?, OpenIDClaim?, NSError?) -> Void) {
self.requestAccess { (response:AnyObject?, error:NSError?) -> Void in
if (error != nil) {
completionHandler(nil, nil, error)
return
}
var paramDict: [String: String] = [:]
if response != nil {
paramDict = ["access_token": response! as! String]
}
if let userInfoEndpoint = self.config.userInfoEndpoint {
self.http.request(.GET, path: userInfoEndpoint, parameters: paramDict, completionHandler: {(responseObject, error) in
if (error != nil) {
completionHandler(nil, nil, error)
return
}
if let unwrappedResponse = responseObject as? String {
let data = unwrappedResponse.dataUsingEncoding(NSUTF8StringEncoding)
let json: AnyObject? = try! NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions(rawValue: 0))
var openIDClaims: FacebookOpenIDClaim?
if let unwrappedResponse = json as? [String: AnyObject] {
openIDClaims = FacebookOpenIDClaim(fromDict: unwrappedResponse)
}
completionHandler(response, openIDClaims, nil)
}
})
} else {
completionHandler(nil, nil, NSError(domain: "OAuth2Module", code: 0, userInfo: ["OpenID Connect" : "No UserInfo endpoint available in config"]))
return
}
}
}
}

View File

@ -0,0 +1,126 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
An OAuth2Module subclass specific to 'Keycloak' authorization
*/
public class KeycloakOAuth2Module: OAuth2Module {
public override func revokeAccess(completionHandler: (AnyObject?, NSError?) -> Void) {
// return if not yet initialized
if (self.oauth2Session.accessToken == nil) {
return;
}
let paramDict:[String:String] = [ "client_id": config.clientId, "refresh_token": self.oauth2Session.refreshToken!]
http.request(.POST, path: config.revokeTokenEndpoint!, parameters: paramDict, completionHandler: { (response, error) in
if (error != nil) {
completionHandler(nil, error)
return
}
self.oauth2Session.clearTokens()
completionHandler(response, nil)
})
}
/**
Gateway to login with OpenIDConnect
:param: completionHandler A block object to be executed when the request operation finishes.
*/
public override func login(completionHandler: (AnyObject?, OpenIDClaim?, NSError?) -> Void) {
var openIDClaims: OpenIDClaim?
self.requestAccess { (response: AnyObject?, error: NSError?) -> Void in
if (error != nil) {
completionHandler(nil, nil, error)
return
}
let accessToken = response as? String
if let accessToken = accessToken {
let token = self.decode(accessToken)
if let decodedToken = token {
openIDClaims = OpenIDClaim(fromDict: decodedToken)
}
}
completionHandler(accessToken, openIDClaims, nil)
}
}
/**
Request to refresh an access token.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
public override func refreshAccessToken(completionHandler: (AnyObject?, NSError?) -> Void) {
if let unwrappedRefreshToken = self.oauth2Session.refreshToken {
var paramDict: [String: String] = ["refresh_token": unwrappedRefreshToken, "client_id": config.clientId, "grant_type": "refresh_token"]
if (config.clientSecret != nil) {
paramDict["client_secret"] = config.clientSecret!
}
http.request(.POST, path: config.refreshTokenEndpoint!, parameters: paramDict, completionHandler: { (response, error) in
if (error != nil) {
completionHandler(nil, error)
return
}
if let unwrappedResponse = response as? [String: AnyObject] {
let accessToken: String = unwrappedResponse["access_token"] as! String
let refreshToken: String = unwrappedResponse["refresh_token"] as! String
let expiration = unwrappedResponse["expires_in"] as! NSNumber
let exp: String = expiration.stringValue
let expirationRefresh = unwrappedResponse["refresh_expires_in"] as? NSNumber
let expRefresh = expirationRefresh?.stringValue
// in Keycloak refresh token get refreshed every time you use them
self.oauth2Session.saveAccessToken(accessToken, refreshToken: refreshToken, accessTokenExpiration: exp, refreshTokenExpiration: expRefresh)
completionHandler(accessToken, nil);
}
})
}
}
func decode(token: String) -> [String: AnyObject]? {
let string = token.componentsSeparatedByString(".")
let toDecode = string[1] as String
var stringtoDecode: String = toDecode.stringByReplacingOccurrencesOfString("-", withString: "+") // 62nd char of encoding
stringtoDecode = stringtoDecode.stringByReplacingOccurrencesOfString("_", withString: "/") // 63rd char of encoding
switch (stringtoDecode.utf16.count % 4) {
case 2: stringtoDecode = "\(stringtoDecode)=="
case 3: stringtoDecode = "\(stringtoDecode)="
default: // nothing to do stringtoDecode can stay the same
print("")
}
let dataToDecode = NSData(base64EncodedString: stringtoDecode, options: [])
let base64DecodedString = NSString(data: dataToDecode!, encoding: NSUTF8StringEncoding)
var values: [String: AnyObject]?
if let string = base64DecodedString {
if let data = string.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true) {
values = try! NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments) as? [String : AnyObject]
}
}
return values
}
}

View File

@ -0,0 +1,364 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
import UIKit
import AeroGearHttp
/**
Notification constants emitted during oauth authorization flow.
*/
public let AGAppLaunchedWithURLNotification = "AGAppLaunchedWithURLNotification"
public let AGAppDidBecomeActiveNotification = "AGAppDidBecomeActiveNotification"
public let AGAuthzErrorDomain = "AGAuthzErrorDomain"
/**
The current state that this module is in.
- AuthorizationStatePendingExternalApproval: the module is waiting external approval.
- AuthorizationStateApproved: the oauth flow has been approved.
- AuthorizationStateUnknown: the oauth flow is in unknown state (e.g. user clicked cancel).
*/
enum AuthorizationState {
case AuthorizationStatePendingExternalApproval
case AuthorizationStateApproved
case AuthorizationStateUnknown
}
/**
Parent class of any OAuth2 module implementing generic OAuth2 authorization flow.
*/
public class OAuth2Module: AuthzModule {
let config: Config
var http: Http
var oauth2Session: OAuth2Session
var applicationLaunchNotificationObserver: NSObjectProtocol?
var applicationDidBecomeActiveNotificationObserver: NSObjectProtocol?
var state: AuthorizationState
var webView: OAuth2WebViewController?
/**
Initialize an OAuth2 module.
:param: config the configuration object that setups the module.
:param: session the session that that module will be bound to.
:param: requestSerializer the actual request serializer to use when performing requests.
:param: responseSerializer the actual response serializer to use upon receiving a response.
:returns: the newly initialized OAuth2Module.
*/
public required init(config: Config, session: OAuth2Session? = nil, requestSerializer: RequestSerializer = HttpRequestSerializer(), responseSerializer: ResponseSerializer = JsonResponseSerializer()) {
if (config.accountId == nil) {
config.accountId = "ACCOUNT_FOR_CLIENTID_\(config.clientId)"
}
if (session == nil) {
self.oauth2Session = TrustedPersistantOAuth2Session(accountId: config.accountId!)
} else {
self.oauth2Session = session!
}
self.config = config
if config.isWebView {
self.webView = OAuth2WebViewController()
}
self.http = Http(baseURL: config.baseURL, requestSerializer: requestSerializer, responseSerializer: responseSerializer)
self.state = .AuthorizationStateUnknown
}
// MARK: Public API - To be overriden if necessary by OAuth2 specific adapter
/**
Request an authorization code.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
public func requestAuthorizationCode(completionHandler: (AnyObject?, NSError?) -> Void) {
// register with the notification system in order to be notified when the 'authorization' process completes in the
// external browser, and the oauth code is available so that we can then proceed to request the 'access_token'
// from the server.
applicationLaunchNotificationObserver = NSNotificationCenter.defaultCenter().addObserverForName(AGAppLaunchedWithURLNotification, object: nil, queue: nil, usingBlock: { (notification: NSNotification!) -> Void in
self.extractCode(notification, completionHandler: completionHandler)
if ( self.webView != nil ) {
UIApplication.sharedApplication().keyWindow?.rootViewController?.dismissViewControllerAnimated(true, completion: nil)
}
})
// register to receive notification when the application becomes active so we
// can clear any pending authorization requests which are not completed properly,
// that is a user switched into the app without Accepting or Cancelling the authorization
// request in the external browser process.
applicationDidBecomeActiveNotificationObserver = NSNotificationCenter.defaultCenter().addObserverForName(AGAppDidBecomeActiveNotification, object:nil, queue:nil, usingBlock: { (note: NSNotification!) -> Void in
// check the state
if (self.state == .AuthorizationStatePendingExternalApproval) {
// unregister
self.stopObserving()
// ..and update state
self.state = .AuthorizationStateUnknown;
}
})
// update state to 'Pending'
self.state = .AuthorizationStatePendingExternalApproval
// calculate final url
let params = "?scope=\(config.scope)&redirect_uri=\(config.redirectURL.urlEncode())&client_id=\(config.clientId)&response_type=code"
guard let computedUrl = http.calculateURL(config.baseURL, url:config.authzEndpoint) else {
let error = NSError(domain:AGAuthzErrorDomain, code:0, userInfo:["NSLocalizedDescriptionKey": "Malformatted URL."])
completionHandler(nil, error)
return
}
let url = NSURL(string:computedUrl.absoluteString + params)
if let url = url {
if self.webView != nil {
self.webView!.targetURL = url
UIApplication.sharedApplication().keyWindow?.rootViewController?.presentViewController(self.webView!, animated: true, completion: nil)
} else {
UIApplication.sharedApplication().openURL(url)
}
}
}
/**
Request to refresh an access token.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
public func refreshAccessToken(completionHandler: (AnyObject?, NSError?) -> Void) {
if let unwrappedRefreshToken = self.oauth2Session.refreshToken {
var paramDict: [String: String] = ["refresh_token": unwrappedRefreshToken, "client_id": config.clientId, "grant_type": "refresh_token"]
if (config.clientSecret != nil) {
paramDict["client_secret"] = config.clientSecret!
}
http.request(.POST, path: config.refreshTokenEndpoint!, parameters: paramDict, completionHandler: { (response, error) in
if (error != nil) {
completionHandler(nil, error)
return
}
if let unwrappedResponse = response as? [String: AnyObject] {
let accessToken: String = unwrappedResponse["access_token"] as! String
let expiration = unwrappedResponse["expires_in"] as! NSNumber
let exp: String = expiration.stringValue
self.oauth2Session.saveAccessToken(accessToken, refreshToken: unwrappedRefreshToken, accessTokenExpiration: exp, refreshTokenExpiration: nil)
completionHandler(unwrappedResponse["access_token"], nil);
}
})
}
}
/**
Exchange an authorization code for an access token.
:param: code the 'authorization' code to exchange for an access token.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
public func exchangeAuthorizationCodeForAccessToken(code: String, completionHandler: (AnyObject?, NSError?) -> Void) {
var paramDict: [String: String] = ["code": code, "client_id": config.clientId, "redirect_uri": config.redirectURL, "grant_type":"authorization_code"]
if let unwrapped = config.clientSecret {
paramDict["client_secret"] = unwrapped
}
http.request(.POST, path: config.accessTokenEndpoint, parameters: paramDict, completionHandler: {(responseObject, error) in
if (error != nil) {
completionHandler(nil, error)
return
}
if let unwrappedResponse = responseObject as? [String: AnyObject] {
let accessToken: String = unwrappedResponse["access_token"] as! String
let refreshToken: String? = unwrappedResponse["refresh_token"] as? String
let expiration = unwrappedResponse["expires_in"] as? NSNumber
let exp: String? = expiration?.stringValue
// expiration for refresh token is used in Keycloak
let expirationRefresh = unwrappedResponse["refresh_expires_in"] as? NSNumber
let expRefresh = expirationRefresh?.stringValue
self.oauth2Session.saveAccessToken(accessToken, refreshToken: refreshToken, accessTokenExpiration: exp, refreshTokenExpiration: expRefresh)
completionHandler(accessToken, nil)
}
})
}
/**
Gateway to request authorization access.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
public func requestAccess(completionHandler: (AnyObject?, NSError?) -> Void) {
if (self.oauth2Session.accessToken != nil && self.oauth2Session.tokenIsNotExpired()) {
// we already have a valid access token, nothing more to be done
completionHandler(self.oauth2Session.accessToken!, nil);
} else if (self.oauth2Session.refreshToken != nil && self.oauth2Session.refreshTokenIsNotExpired()) {
// need to refresh token
self.refreshAccessToken(completionHandler)
} else {
// ask for authorization code and once obtained exchange code for access token
self.requestAuthorizationCode(completionHandler)
}
}
/**
Gateway to provide authentication using the Authorization Code Flow with OpenID Connect.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
public func login(completionHandler: (AnyObject?, OpenIDClaim?, NSError?) -> Void) {
self.requestAccess { (response:AnyObject?, error:NSError?) -> Void in
if (error != nil) {
completionHandler(nil, nil, error)
return
}
var paramDict: [String: String] = [:]
if response != nil {
paramDict = ["access_token": response! as! String]
}
if let userInfoEndpoint = self.config.userInfoEndpoint {
self.http.request(.GET, path:userInfoEndpoint, parameters: paramDict, completionHandler: {(responseObject, error) in
if (error != nil) {
completionHandler(nil, nil, error)
return
}
var openIDClaims: OpenIDClaim?
if let unwrappedResponse = responseObject as? [String: AnyObject] {
openIDClaims = OpenIDClaim(fromDict: unwrappedResponse)
}
completionHandler(response, openIDClaims, nil)
})
} else {
completionHandler(nil, nil, NSError(domain: "OAuth2Module", code: 0, userInfo: ["OpenID Connect" : "No UserInfo endpoint available in config"]))
return
}
}
}
/**
Request to revoke access.
:param: completionHandler A block object to be executed when the request operation finishes.
*/
public func revokeAccess(completionHandler: (AnyObject?, NSError?) -> Void) {
// return if not yet initialized
if (self.oauth2Session.accessToken == nil) {
return;
}
let paramDict:[String:String] = ["token":self.oauth2Session.accessToken!]
http.request(.POST, path: config.revokeTokenEndpoint!, parameters: paramDict, completionHandler: { (response, error) in
if (error != nil) {
completionHandler(nil, error)
return
}
self.oauth2Session.clearTokens()
completionHandler(response, nil)
})
}
/**
Return any authorization fields.
:returns: a dictionary filled with the authorization fields.
*/
public func authorizationFields() -> [String: String]? {
if (self.oauth2Session.accessToken == nil) {
return nil
} else {
return ["Authorization":"Bearer \(self.oauth2Session.accessToken!)"]
}
}
/**
Returns a boolean indicating whether authorization has been granted.
:returns: true if authorized, false otherwise.
*/
public func isAuthorized() -> Bool {
return self.oauth2Session.accessToken != nil && self.oauth2Session.tokenIsNotExpired()
}
// MARK: Internal Methods
func extractCode(notification: NSNotification, completionHandler: (AnyObject?, NSError?) -> Void) {
let url: NSURL? = (notification.userInfo as! [String: AnyObject])[UIApplicationLaunchOptionsURLKey] as? NSURL
// extract the code from the URL
let code = self.parametersFromQueryString(url?.query)["code"]
// if exists perform the exchange
if (code != nil) {
self.exchangeAuthorizationCodeForAccessToken(code!, completionHandler: completionHandler)
// update state
state = .AuthorizationStateApproved
} else {
let error = NSError(domain:AGAuthzErrorDomain, code:0, userInfo:["NSLocalizedDescriptionKey": "User cancelled authorization."])
completionHandler(nil, error)
}
// finally, unregister
self.stopObserving()
}
func parametersFromQueryString(queryString: String?) -> [String: String] {
var parameters = [String: String]()
if (queryString != nil) {
let parameterScanner: NSScanner = NSScanner(string: queryString!)
var name:NSString? = nil
var value:NSString? = nil
while (parameterScanner.atEnd != true) {
name = nil;
parameterScanner.scanUpToString("=", intoString: &name)
parameterScanner.scanString("=", intoString:nil)
value = nil
parameterScanner.scanUpToString("&", intoString:&value)
parameterScanner.scanString("&", intoString:nil)
if (name != nil && value != nil) {
parameters[name!.stringByReplacingPercentEscapesUsingEncoding(NSUTF8StringEncoding)!] = value!.stringByReplacingPercentEscapesUsingEncoding(NSUTF8StringEncoding)
}
}
}
return parameters;
}
deinit {
self.stopObserving()
}
func stopObserving() {
// clear all observers
if (applicationLaunchNotificationObserver != nil) {
NSNotificationCenter.defaultCenter().removeObserver(applicationLaunchNotificationObserver!)
self.applicationLaunchNotificationObserver = nil;
}
if (applicationDidBecomeActiveNotificationObserver != nil) {
NSNotificationCenter.defaultCenter().removeObserver(applicationDidBecomeActiveNotificationObserver!)
applicationDidBecomeActiveNotificationObserver = nil
}
}
}

View File

@ -0,0 +1,75 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
The protocol that an OAuth2 Session modules must adhere to and represent storage of oauth specific metadata. See TrustedPersistantOAuth2Session and UntrustedMemoryOAuth2Session as example implementations
*/
public protocol OAuth2Session {
/**
The account id.
*/
var accountId: String {get}
/**
The access token which expires.
*/
var accessToken: String? {get set}
/**
The access token's expiration date.
*/
var accessTokenExpirationDate: NSDate? {get set}
/**
The refresh token's expiration date.
*/
var refreshTokenExpirationDate: NSDate? {get set}
/**
The refresh tokens. This toke does not expire and should be used to renew access token when expired.
*/
var refreshToken: String? {get set}
/**
Check validity of accessToken. return true if still valid, false when expired.
*/
func tokenIsNotExpired() -> Bool
/**
Check validity of refreshToken. return true if still valid, false when expired.
*/
func refreshTokenIsNotExpired() -> Bool
/**
Clears any tokens storage
*/
func clearTokens()
/**
Save tokens information. Saving tokens allow you to refresh accesstoken transparently for the user without prompting
for grant access.
:param: accessToken the access token.
:param: refreshToken the refresh token.
:param: accessTokenExpiration the expiration for the access token.
:param: refreshTokenExpiration the expiration for the refresh token.
*/
func saveAccessToken(accessToken: String?, refreshToken: String?, accessTokenExpiration: String?, refreshTokenExpiration: String?)
}

View File

@ -0,0 +1,53 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
import UIKit
/**
OAuth2WebViewController is a UIViewController to be used when the Oauth2 flow used an embedded view controller
rather than an external browser approach.
*/
class OAuth2WebViewController: UIViewController, UIWebViewDelegate {
/// Login URL for OAuth.
var targetURL : NSURL = NSURL()
/// WebView intance used to load login page.
var webView : UIWebView = UIWebView()
/// Overrride of viewDidLoad to load the login page.
override internal func viewDidLoad() {
super.viewDidLoad()
webView.frame = UIScreen.mainScreen().applicationFrame
webView.delegate = self
self.view.addSubview(webView)
loadAddressURL()
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
self.webView.frame = self.view.bounds
}
override internal func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
func loadAddressURL() {
let req = NSURLRequest(URL: targetURL)
webView.loadRequest(req)
}
}

View File

@ -0,0 +1,109 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
/**
Standard claims as described in spec: http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
*/
public class OpenIDClaim: CustomStringConvertible {
/// Subject - Identifier for the End-User at the Issuer.
public var sub: String?
/// End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences.
public var name: String?
/// Given name(s) or first name(s) of the End-User.
public var givenName: String?
/// Surname(s) or last name(s) of the End-User.
public var familyName: String?
/// Middle name(s) of the End-User.
public var middleName: String?
/// Casual name of the End-User that may or may not be the same as the given_name.
public var nickname: String?
/// Shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe.
public var preferredUsername: String?
/// URL of the End-User's profile page.
public var profile: String?
/// URL of the End-User's profile picture. This URL MUST refer to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image.
public var picture: String?
/// URL of the End-User's Web page or blog. This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with.
public var website: String?
/// End-User's preferred e-mail address.
public var email: String?
/// True if the End-User's e-mail address has been verified; otherwise false.
public var emailVerified: Bool?
/// End-User's gender. Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable.
public var gender: String?
/// End-User's birthday, represented as an ISO 8601:2004 [ISO86012004] YYYY-MM-DD format.
public var birthdate: String?
/// String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone. For example, Europe/Paris or America/Los_Angeles.
public var zoneinfo: String?
/// [ISO31661] country code in uppercase, separated by a dash. For example, en-US or fr-CA.
public var locale: String?
/// End-User's preferred telephone number.
public var phoneNumber: String?
/// True if the End-User's phone number has been verified; otherwise false.
public var phoneNumberVerified: Bool?
/// End-User's preferred postal address.
public var address: [String: AnyObject?]?
/// Time the End-User's information was last updated.
public var updatedAt: Int?
// google specific - not in spec?
public var kind: String?
public var hd: String?
/// Display all the claims.
public var description: String {
return "sub: \(sub)\nname: \(name)\ngivenName: \(givenName)\nfamilyName: \(familyName)\nmiddleName: \(middleName)\n" +
"nickname: \(nickname)\npreferredUsername: \(preferredUsername)\nprofile: \(profile)\npicture: \(picture)\n" +
"website: \(website)\nemail: \(email)\nemailVerified: \(emailVerified)\ngender: \(gender)\nbirthdate: \(birthdate)\n"
}
/// Initialize an OpenIDClaim from a dictionary. all information not available are optional values set to .None.
public init(fromDict:[String: AnyObject]) {
sub = fromDict["sub"] as? String
name = fromDict["name"] as? String
givenName = fromDict["given_name"] as? String
familyName = fromDict["family_name"] as? String
middleName = fromDict["middle_name"] as? String
nickname = fromDict["nickname"] as? String
preferredUsername = fromDict["preferred_username"] as? String
profile = fromDict["profile"] as? String
picture = fromDict["picture"] as? String
website = fromDict["website"] as? String
email = fromDict["email"] as? String
emailVerified = fromDict["email_verified"] as? Bool
gender = fromDict["gender"] as? String
zoneinfo = fromDict["zoneinfo"] as? String
locale = fromDict["locale"] as? String
phoneNumber = fromDict["phone_number"] as? String
phoneNumberVerified = fromDict["phone_number_verified"] as? Bool
updatedAt = fromDict["updated_at"] as? Int
kind = fromDict["sub"] as? String
hd = fromDict["hd"] as? String
}
}
/// Facebook specific claims.
public class FacebookOpenIDClaim: OpenIDClaim {
override init(fromDict:[String: AnyObject]) {
super.init(fromDict: fromDict)
givenName = fromDict["first_name"] as? String
familyName = fromDict["last_name"] as? String
zoneinfo = fromDict["timezone"] as? String
}
}

View File

@ -0,0 +1,333 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
import Security
import UIKit
/**
The type of token to be saved in KeychainWrap:
- AccessToken: access token
- ExpirationDate: access token expiration date
- RefreshToken: refresh token
- RefreshExpirationDate: refresh token expiration date (used for Keycloak adapter only)
*/
public enum TokenType: String {
case AccessToken = "AccessToken"
case RefreshToken = "RefreshToken"
case ExpirationDate = "ExpirationDate"
case RefreshExpirationDate = "RefreshExpirationDate"
}
/**
A handy Keychain wrapper. It saves your OAuth2 tokens using WhenPasscodeSet ACL.
*/
public class KeychainWrap {
/**
The service id. By default set to apple bundle id.
*/
public var serviceIdentifier: String
/**
The group id is Keychain access group which is used for sharing keychain content accross multiple apps issued from same developer. By default there is no access group.
*/
public var groupId: String?
/**
Initialize KeychainWrapper setting default values.
:param: serviceId unique service, defulated to bundleId
:param: groupId used for SSO between app issued from same developer certificate.
*/
public init(serviceId: String? = NSBundle.mainBundle().bundleIdentifier, groupId: String? = nil) {
if serviceId == nil {
self.serviceIdentifier = "unkown"
} else {
self.serviceIdentifier = serviceId!
}
self.groupId = groupId
}
/**
Save tokens information in Keychain.
:param: key usually use accountId for oauth2 module, any unique string.
:param: tokenType type of token: access, refresh.
:param: value string value of the token.
*/
public func save(key: String, tokenType: TokenType, value: String) -> Bool {
let dataFromString: NSData? = value.dataUsingEncoding(NSUTF8StringEncoding)
if (dataFromString == nil) {
return false
}
// Instantiate a new default keychain query
let keychainQuery = NSMutableDictionary()
if let groupId = self.groupId {
keychainQuery[kSecAttrAccessGroup as String] = groupId
}
keychainQuery[kSecClass as String] = kSecClassGenericPassword
keychainQuery[kSecAttrService as String] = self.serviceIdentifier
keychainQuery[kSecAttrAccount as String] = key + "_" + tokenType.rawValue
keychainQuery[kSecAttrAccessible as String] = kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly
// Search for the keychain items
let statusSearch: OSStatus = SecItemCopyMatching(keychainQuery, nil)
// if found update
if (statusSearch == errSecSuccess) {
if (dataFromString != nil) {
let attributesToUpdate = NSMutableDictionary()
attributesToUpdate[kSecValueData as String] = dataFromString!
let statusUpdate: OSStatus = SecItemUpdate(keychainQuery, attributesToUpdate)
if (statusUpdate != errSecSuccess) {
print("tokens not updated")
return false
}
} else { // revoked token or newly installed app, clear KC
return self.resetKeychain()
}
} else if(statusSearch == errSecItemNotFound) { // if new, add
keychainQuery[kSecValueData as String] = dataFromString!
let statusAdd: OSStatus = SecItemAdd(keychainQuery, nil)
if(statusAdd != errSecSuccess) {
print("tokens not saved")
return false
}
} else { // error case
return false
}
return true
}
/**
Read tokens information in Keychain. If the entry is not found return nil.
:param: userAccount key of the keychain entry, usually accountId for oauth2 module.
:param: tokenType type of token: access, refresh.
*/
public func read(userAccount: String, tokenType: TokenType) -> String? {
let keychainQuery = NSMutableDictionary()
if let groupId = self.groupId {
keychainQuery[kSecAttrAccessGroup as String] = groupId
}
keychainQuery[kSecClass as String] = kSecClassGenericPassword
keychainQuery[kSecAttrService as String] = self.serviceIdentifier
keychainQuery[kSecAttrAccount as String] = userAccount + "_" + tokenType.rawValue
keychainQuery[kSecReturnData as String] = true
keychainQuery[kSecAttrAccessible as String] = kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly
var dataTypeRef: Unmanaged<AnyObject>?
// Search for the keychain items
let status: OSStatus = withUnsafeMutablePointer(&dataTypeRef) { SecItemCopyMatching(keychainQuery as CFDictionaryRef, UnsafeMutablePointer($0)) }
if (status == errSecItemNotFound) {
print("\(tokenType.rawValue) not found")
return nil
} else if (status != errSecSuccess) {
print("Error attempting to retrieve \(tokenType.rawValue) with error code \(status) ")
return nil
}
let opaque = dataTypeRef?.toOpaque()
var contentsOfKeychain: String?
if let op = opaque {
let retrievedData = Unmanaged<NSData>.fromOpaque(op).takeUnretainedValue()
// Convert the data retrieved from the keychain into a string
contentsOfKeychain = NSString(data: retrievedData, encoding: NSUTF8StringEncoding) as? String
} else {
print("Nothing was retrieved from the keychain. Status code \(status)")
}
return contentsOfKeychain
}
/**
Clear all keychain entries. Note that Keychain can only be cleared progemmatically.
*/
public func resetKeychain() -> Bool {
return self.deleteAllKeysForSecClass(kSecClassGenericPassword) &&
self.deleteAllKeysForSecClass(kSecClassInternetPassword) &&
self.deleteAllKeysForSecClass(kSecClassCertificate) &&
self.deleteAllKeysForSecClass(kSecClassKey) &&
self.deleteAllKeysForSecClass(kSecClassIdentity)
}
func deleteAllKeysForSecClass(secClass: CFTypeRef) -> Bool {
let keychainQuery = NSMutableDictionary()
keychainQuery[kSecClass as String] = secClass
let result:OSStatus = SecItemDelete(keychainQuery)
if (result == errSecSuccess) {
return true
} else {
return false
}
}
}
/**
An OAuth2Session implementation to store OAuth2 metadata using the Keychain.
*/
public class TrustedPersistantOAuth2Session: OAuth2Session {
/**
The account id.
*/
public var accountId: String
/**
The access token's expiration date.
*/
public var accessTokenExpirationDate: NSDate? {
get {
let dateAsString = self.keychain.read(self.accountId, tokenType: .ExpirationDate)
if let unwrappedDate:String = dateAsString {
return NSDate(dateString: unwrappedDate)
} else {
return nil
}
}
set(value) {
if let unwrappedValue = value {
self.keychain.save(self.accountId, tokenType: .ExpirationDate, value: unwrappedValue.toString())
}
}
}
/**
The access token. The information is read securely from Keychain.
*/
public var accessToken: String? {
get {
return self.keychain.read(self.accountId, tokenType: .AccessToken)
}
set(value) {
if let unwrappedValue = value {
self.keychain.save(self.accountId, tokenType: .AccessToken, value: unwrappedValue)
}
}
}
/**
The refresh token. The information is read securely from Keychain.
*/
public var refreshToken: String? {
get {
return self.keychain.read(self.accountId, tokenType: .RefreshToken)
}
set(value) {
if let unwrappedValue = value {
self.keychain.save(self.accountId, tokenType: .RefreshToken, value: unwrappedValue)
}
}
}
/**
The refresh token's expiration date.
*/
public var refreshTokenExpirationDate: NSDate? {
get {
let dateAsString = self.keychain.read(self.accountId, tokenType: .RefreshExpirationDate)
if let unwrappedDate:String = dateAsString {
return NSDate(dateString: unwrappedDate)
} else {
return nil
}
}
set(value) {
if let unwrappedValue = value {
_ = self.keychain.save(self.accountId, tokenType: .RefreshExpirationDate, value: unwrappedValue.toString())
}
}
}
private let keychain: KeychainWrap
/**
Check validity of accessToken. return true if still valid, false when expired.
*/
public func tokenIsNotExpired() -> Bool {
return self.accessTokenExpirationDate != nil ? (self.accessTokenExpirationDate!.timeIntervalSinceDate(NSDate()) > 0) : true
}
/**
Check validity of refreshToken. return true if still valid, false when expired.
*/
public func refreshTokenIsNotExpired() -> Bool {
return self.refreshTokenExpirationDate != nil ? (self.refreshTokenExpirationDate!.timeIntervalSinceDate(NSDate()) > 0) : true
}
/**
Save in memory tokens information. Saving tokens allow you to refresh accesstoken transparently for the user without prompting for grant access.
*/
public func saveAccessToken(accessToken: String?, refreshToken: String?, accessTokenExpiration: String?, refreshTokenExpiration: String?) {
self.accessToken = accessToken
self.refreshToken = refreshToken
let now = NSDate()
if let inter = accessTokenExpiration?.doubleValue {
self.accessTokenExpirationDate = now.dateByAddingTimeInterval(inter)
}
if let inter = refreshTokenExpiration?.doubleValue {
self.refreshTokenExpirationDate = now.dateByAddingTimeInterval(inter)
}
}
/**
Clear all tokens. Method used when doing logout or revoke.
*/
public func clearTokens() {
self.accessToken = nil
self.refreshToken = nil
self.accessTokenExpirationDate = nil
self.refreshTokenExpirationDate = nil
}
/**
Initialize TrustedPersistantOAuth2Session using account id. Account id is the service id used for keychain storage.
:param: accountId uniqueId to identify the oauth2module
:param: groupId used for SSO between app issued from same developer certificate.
:param: accessToken optional parameter to initilaize the storage with initial values
:param: accessTokenExpirationDate optional parameter to initilaize the storage with initial values
:param: refreshToken optional parameter to initilaize the storage with initial values
:param: refreshTokenExpirationDate optional parameter to initilaize the storage with initial values
*/
public init(accountId: String,
groupId: String? = nil,
accessToken: String? = nil,
accessTokenExpirationDate: NSDate? = nil,
refreshToken: String? = nil,
refreshTokenExpirationDate: NSDate? = nil) {
self.accountId = accountId
if groupId != nil {
self.keychain = KeychainWrap(serviceId: groupId, groupId: groupId)
} else {
self.keychain = KeychainWrap()
}
self.accessToken = accessToken
self.refreshToken = refreshToken
self.accessTokenExpirationDate = accessTokenExpirationDate
self.refreshTokenExpirationDate = refreshTokenExpirationDate
}
}

View File

@ -0,0 +1,110 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* 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
extension String {
var doubleValue: Double {
return (self as NSString).doubleValue
}
}
/**
An OAuth2Session implementation the stores OAuth2 metadata in-memory
*/
public class UntrustedMemoryOAuth2Session: OAuth2Session {
/**
The account id.
*/
public var accountId: String
/**
The access token which expires.
*/
public var accessToken: String?
/**
The access token's expiration date.
*/
public var accessTokenExpirationDate: NSDate?
/**
The refresh tokens. This toke does not expire and should be used to renew access token when expired.
*/
public var refreshToken: String?
/**
The refresh token's expiration date.
*/
public var refreshTokenExpirationDate: NSDate?
/**
Check validity of accessToken. return true if still valid, false when expired.
*/
public func tokenIsNotExpired() -> Bool {
return self.accessTokenExpirationDate != nil ? (self.accessTokenExpirationDate!.timeIntervalSinceDate(NSDate()) > 0) : true
}
/**
Check validity of refreshToken. return true if still valid, false when expired.
*/
public func refreshTokenIsNotExpired() -> Bool {
return self.refreshTokenExpirationDate != nil ? (self.refreshTokenExpirationDate!.timeIntervalSinceDate(NSDate()) > 0) : true
}
/**
Save in memory tokens information. Saving tokens allow you to refresh accesstoken transparently for the user without prompting for grant access.
*/
public func saveAccessToken(accessToken: String?, refreshToken: String?, accessTokenExpiration: String?, refreshTokenExpiration: String?) {
self.accessToken = accessToken
self.refreshToken = refreshToken
let now = NSDate()
if let inter = accessTokenExpiration?.doubleValue {
self.accessTokenExpirationDate = now.dateByAddingTimeInterval(inter)
}
if let interRefresh = refreshTokenExpiration?.doubleValue {
self.refreshTokenExpirationDate = now.dateByAddingTimeInterval(interRefresh)
}
}
/**
Clear all tokens. Method used when doing logout or revoke.
*/
public func clearTokens() {
self.accessToken = nil
self.refreshToken = nil
self.accessTokenExpirationDate = nil
self.refreshTokenExpirationDate = nil
}
/**
Initialize session using account id.
:param: accountId uniqueId to identify the oauth2module.
:param: accessToken optional parameter to initilaize the storage with initial values.
:param: accessTokenExpirationDate optional parameter to initilaize the storage with initial values.
:param: refreshToken optional parameter to initilaize the storage with initial values.
:param: refreshTokenExpirationDate optional parameter to initilaize the storage with initial values.
*/
public init(accountId: String, accessToken: String? = nil, accessTokenExpirationDate: NSDate? = nil, refreshToken: String? = nil, refreshTokenExpirationDate: NSDate? = nil) {
self.accessToken = accessToken
self.accessTokenExpirationDate = accessTokenExpirationDate
self.refreshToken = refreshToken
self.refreshTokenExpirationDate = refreshTokenExpirationDate
self.accountId = accountId
}
}

202
Pods/AeroGearOAuth2/LICENSE.txt generated Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

130
Pods/AeroGearOAuth2/README.md generated Normal file
View File

@ -0,0 +1,130 @@
# aerogear-ios-oauth2 [![Build Status](https://travis-ci.org/aerogear/aerogear-ios-oauth2.png)](https://travis-ci.org/aerogear/aerogear-ios-oauth2)
> This module currently build with Xcode 7 and supports iOS8, iOS9.
OAuth2 Client based on [aerogear-ios-http](https://github.com/aerogear/aerogear-ios-http).
Taking care of:
* account manager for multiple OAuth2 accounts,
* request access and refresh token,
* grant access through secure external browser and URI schema to re-enter app,
* (implicit or explicit) refresh tokens,
* revoke tokens,
* permanent secure storage,
* adaptable to OAuth2 specific providers. Existing extensions: Google, Facebook, [Keycloak 1.5.0.Final](http://keycloak.jboss.org/) etc...
* openID Connect login
100% Swift 2.0.
| | Project Info |
| --------------- | ------------- |
| License: | Apache License, Version 2.0 |
| Build: | CocoaPods |
| Documentation: | https://aerogear.org/docs/guides/aerogear-ios-2.X/ |
| Issue tracker: | https://issues.jboss.org/browse/AGIOS |
| Mailing lists: | [aerogear-users](http://aerogear-users.1116366.n5.nabble.com/) ([subscribe](https://lists.jboss.org/mailman/listinfo/aerogear-users)) |
| | [aerogear-dev](http://aerogear-dev.1069024.n5.nabble.com/) ([subscribe](https://lists.jboss.org/mailman/listinfo/aerogear-dev)) |
## Example Usage
#### OAuth2 grant for GET with a predefined config like Facebook
```swift
var Http = Http() // [1]
let facebookConfig = FacebookConfig( // [2]
clientId: "YYY",
clientSecret: "XXX",
scopes:["photo_upload, publish_actions"])
var oauth2Module = AccountManager.addFacebookAccount(facebookConfig) // [3]
http.authzModule = oauth2Module // [4]
http.request(.GET, path: "/get", completionHandler: {(response, error) in // [5]
// handle response
})
```
Create an instance of Http [1] from [aerogear-ios-http](https://github.com/aerogear/aerogear-ios-http) a thin layer on top of NSURLSession.
Fill-in the OAuth2 configuration in [2], here we use a predefined Config with all Facebook endpoint filled-in for us.
Create an OAuth2Module from AccountManager's factory method in [3].
Inject OAuth2Module into http object in [4] and uses the http object to GET/POST etc...
See full description in [aerogear.org](https://aerogear.org/docs/guides/aerogear-ios-2.X/Authorization/)
#### OpenID Connect with Keycloak
```swift
var Http = Http()
let keycloakConfig = KeycloakConfig(
clientId: "sharedshoot-third-party",
host: "http://localhost:8080",
realm: "shoot-realm",
isOpenIDConnect: true)
var oauth2Module = AccountManager.addKeycloakAccount(keycloakConfig)
http.authzModule = oauth2Module
oauth2Module.login {(accessToken: AnyObject?, claims: OpenIDClaim?, error: NSError?) in // [1]
// Do your own stuff here
}
```
Similar approach for configuration, here we want to login as Keycloak user, using ```login``` method we get some user information back in OpenIDClaim object.
> **NOTE:** The latest version of the library works with Keycloak 1.1.0.Final. Previous version of Keycloak 1.0.x will work except for the transparent refresh of tokens (ie: after access token expires you will have to go through grant process).
### Build, test and play with aerogear-ios-oauth2
1. Clone this project
2. Get the dependencies
The project uses [CocoaPods](http://cocoapods.org) for handling its dependencies. As a pre-requisite, install CocoaPods and then install the pod. On the root directory of the project run:
```bash
pod install
```
3. open AeroGearOAuth2.xcworkspace
## Adding the library to your project
To add the library in your project, you can either use [CocoaPods](http://cocoapods.org) or manual install in your project. See the respective sections below for instructions:
### Using [CocoaPods](http://cocoapods.org)
In your ```Podfile``` add:
```
pod 'AeroGearOAuth2'
```
and then:
```bash
pod install
```
to install your dependencies
### Manual Installation
Follow these steps to add the library in your Swift project:
1. Add AeroGearOAuth2 as a [submodule](http://git-scm.com/docs/git-submodule) in your project. Open a terminal and navigate to your project directory. Then enter:
```bash
git submodule add https://github.com/aerogear/aerogear-ios-oauth2.git
```
2. Open the `aerogear-ios-oauth2` folder, and drag the `AeroGearOAuth2.xcodeproj` into the file navigator in Xcode.
3. In Xcode select your application target and under the "Targets" heading section, ensure that the 'iOS Deployment Target' matches the application target of AeroGearOAuth2.framework (Currently set to 8.0).
5. Select the "Build Phases" heading section, expand the "Target Dependencies" group and add `AeroGearOAuth2.framework`.
7. Click on the `+` button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add `AeroGearOAuth2.framework`.
## Documentation
For more details about the current release, please consult [our documentation](https://aerogear.org/docs/guides/aerogear-ios-2.X/).
## Development
If you would like to help develop AeroGear you can join our [developer's mailing list](https://lists.jboss.org/mailman/listinfo/aerogear-dev), join #aerogear on Freenode, or shout at us on Twitter @aerogears.
Also takes some time and skim the [contributor guide](http://aerogear.org/docs/guides/Contributing/)
## Questions?
Join our [user mailing list](https://lists.jboss.org/mailman/listinfo/aerogear-users) for any questions or help! We really hope you enjoy app development with AeroGear!
## Found a bug?
If you found a bug please create a ticket for us on [Jira](https://issues.jboss.org/browse/AGIOS) with some steps to reproduce it.

8
Pods/Manifest.lock generated
View File

@ -1,4 +1,7 @@
PODS:
- AeroGearHttp (0.5.1)
- AeroGearOAuth2 (0.5.1):
- AeroGearHttp
- AFNetworking (2.6.3):
- AFNetworking/NSURLConnection (= 2.6.3)
- AFNetworking/NSURLSession (= 2.6.3)
@ -78,6 +81,7 @@ PODS:
- SwiftyJSON (2.3.2)
DEPENDENCIES:
- AeroGearOAuth2
- Alamofire-SwiftyJSON
- FBSDKCoreKit
- FBSDKLoginKit
@ -89,6 +93,8 @@ DEPENDENCIES:
- PicoKit
SPEC CHECKSUMS:
AeroGearHttp: 9eb405b694aa9ac5daff842f68648f4a9fe0fa66
AeroGearOAuth2: 6f29d3fac8b78a0ff6d51b04c4ba1a02baed2e52
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
Alamofire: c19a627cefd6a95f840401c49ab1f124e07f54ee
Alamofire-SwiftyJSON: 5812bb37accc36897cc2f2dabb070d8ebcd7ac98
@ -110,6 +116,6 @@ SPEC CHECKSUMS:
PicoKit: 9079bce659a8d5408c8af1c45254b971df614de3
SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a
PODFILE CHECKSUM: b38736b343fb2b19e963a4b958d967b3d0cd4d11
PODFILE CHECKSUM: e5c9f5e7183188f117de0f8635164df8a5f04bf6
COCOAPODS: 1.0.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = 'primary'
BlueprintIdentifier = 'B6184234CE5B97D6DADDB68315E67B58'
BlueprintName = 'AeroGearHttp'
ReferencedContainer = 'container:Pods.xcodeproj'
BuildableName = 'AeroGearHttp.framework'>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = 'primary'
BlueprintIdentifier = '8E87CBA9EBF6671AAFD3A8CCD2C3875B'
BlueprintName = 'AeroGearOAuth2'
ReferencedContainer = 'container:Pods.xcodeproj'
BuildableName = 'AeroGearOAuth2.framework'>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A9D1431CC26974F3974E211FB2B489BB"
BlueprintIdentifier = "E4EEF93D5D2D1222C39B213D582C76D7"
BuildableName = "Pods_Vendoo.framework"
BlueprintName = "Pods-Vendoo"
ReferencedContainer = "container:Pods.xcodeproj">
@ -45,7 +45,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A9D1431CC26974F3974E211FB2B489BB"
BlueprintIdentifier = "E4EEF93D5D2D1222C39B213D582C76D7"
BuildableName = "Pods_Vendoo.framework"
BlueprintName = "Pods-Vendoo"
ReferencedContainer = "container:Pods.xcodeproj">

View File

@ -9,6 +9,16 @@
<key>isShown</key>
<false/>
</dict>
<key>AeroGearHttp.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
</dict>
<key>AeroGearOAuth2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
</dict>
<key>Alamofire-SwiftyJSON.xcscheme</key>
<dict>
<key>isShown</key>
@ -137,12 +147,17 @@
<key>primary</key>
<true/>
</dict>
<key>8E87CBA9EBF6671AAFD3A8CCD2C3875B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>92943306EC8070DF9CD02ECD505D2CD5</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>A9D1431CC26974F3974E211FB2B489BB</key>
<key>B6184234CE5B97D6DADDB68315E67B58</key>
<dict>
<key>primary</key>
<true/>
@ -157,6 +172,11 @@
<key>primary</key>
<true/>
</dict>
<key>E4EEF93D5D2D1222C39B213D582C76D7</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_AeroGearHttp : NSObject
@end
@implementation PodsDummy_AeroGearHttp
@end

View File

@ -0,0 +1,4 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif

View File

@ -0,0 +1,6 @@
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double AeroGearHttpVersionNumber;
FOUNDATION_EXPORT const unsigned char AeroGearHttpVersionString[];

View File

@ -0,0 +1,6 @@
framework module AeroGearHttp {
umbrella header "AeroGearHttp-umbrella.h"
export *
module * { export * }
}

View File

@ -0,0 +1,9 @@
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.5.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_AeroGearOAuth2 : NSObject
@end
@implementation PodsDummy_AeroGearOAuth2
@end

View File

@ -0,0 +1,4 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif

View File

@ -0,0 +1,6 @@
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double AeroGearOAuth2VersionNumber;
FOUNDATION_EXPORT const unsigned char AeroGearOAuth2VersionString[];

View File

@ -0,0 +1,6 @@
framework module AeroGearOAuth2 {
umbrella header "AeroGearOAuth2-umbrella.h"
export *
module * { export * }
}

View File

@ -0,0 +1,11 @@
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_LDFLAGS = -framework "Security"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.5.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -24,6 +24,418 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
## AeroGearHttp
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
## AeroGearOAuth2
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
## Alamofire
Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)

View File

@ -39,6 +39,426 @@ THE SOFTWARE.
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
</string>
<key>Title</key>
<string>AeroGearHttp</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
</string>
<key>Title</key>
<string>AeroGearOAuth2</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)

View File

@ -85,6 +85,8 @@ strip_invalid_archs() {
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "$BUILT_PRODUCTS_DIR/AFNetworking/AFNetworking.framework"
install_framework "$BUILT_PRODUCTS_DIR/AeroGearHttp/AeroGearHttp.framework"
install_framework "$BUILT_PRODUCTS_DIR/AeroGearOAuth2/AeroGearOAuth2.framework"
install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework"
install_framework "$BUILT_PRODUCTS_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework"
install_framework "$BUILT_PRODUCTS_DIR/Bolts/Bolts.framework"
@ -99,6 +101,8 @@ if [[ "$CONFIGURATION" == "Debug" ]]; then
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "$BUILT_PRODUCTS_DIR/AFNetworking/AFNetworking.framework"
install_framework "$BUILT_PRODUCTS_DIR/AeroGearHttp/AeroGearHttp.framework"
install_framework "$BUILT_PRODUCTS_DIR/AeroGearOAuth2/AeroGearOAuth2.framework"
install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework"
install_framework "$BUILT_PRODUCTS_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework"
install_framework "$BUILT_PRODUCTS_DIR/Bolts/Bolts.framework"

View File

@ -1,10 +1,10 @@
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseAuth/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" "${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks" "${PODS_ROOT}/GoogleNetworkingUtilities/Frameworks" "${PODS_ROOT}/GoogleSymbolUtilities/Frameworks" "${PODS_ROOT}/GoogleUtilities/Frameworks"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseAuth/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" "${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks" "${PODS_ROOT}/GoogleNetworkingUtilities/Frameworks" "${PODS_ROOT}/GoogleSymbolUtilities/Frameworks" "${PODS_ROOT}/GoogleUtilities/Frameworks"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) ${PODS_ROOT}/Firebase/Headers $(SDKROOT)/usr/include/libxml2 $(PODS_ROOT)/GDataXML-HTML/libxml $(SDKROOT)/usr/include/libxml2 $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AdSupport" -framework "AddressBook" -framework "Alamofire" -framework "Alamofire_SwiftyJSON" -framework "Bolts" -framework "CoreGraphics" -framework "FBSDKCoreKit" -framework "FBSDKLoginKit" -framework "FBSDKShareKit" -framework "FirebaseAnalytics" -framework "FirebaseAuth" -framework "FirebaseInstanceID" -framework "GDataXML_HTML" -framework "GoogleInterchangeUtilities" -framework "GoogleNetworkingUtilities" -framework "GoogleSymbolUtilities" -framework "GoogleUtilities" -framework "Locksmith" -framework "OAuthSwift" -framework "PicoKit" -framework "SafariServices" -framework "Security" -framework "StoreKit" -framework "SwiftyJSON" -framework "SystemConfiguration"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp/AeroGearHttp.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2/AeroGearOAuth2.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AdSupport" -framework "AddressBook" -framework "AeroGearHttp" -framework "AeroGearOAuth2" -framework "Alamofire" -framework "Alamofire_SwiftyJSON" -framework "Bolts" -framework "CoreGraphics" -framework "FBSDKCoreKit" -framework "FBSDKLoginKit" -framework "FBSDKShareKit" -framework "FirebaseAnalytics" -framework "FirebaseAuth" -framework "FirebaseInstanceID" -framework "GDataXML_HTML" -framework "GoogleInterchangeUtilities" -framework "GoogleNetworkingUtilities" -framework "GoogleSymbolUtilities" -framework "GoogleUtilities" -framework "Locksmith" -framework "OAuthSwift" -framework "PicoKit" -framework "SafariServices" -framework "Security" -framework "StoreKit" -framework "SwiftyJSON" -framework "SystemConfiguration"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

View File

@ -1,10 +1,10 @@
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseAuth/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" "${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks" "${PODS_ROOT}/GoogleNetworkingUtilities/Frameworks" "${PODS_ROOT}/GoogleSymbolUtilities/Frameworks" "${PODS_ROOT}/GoogleUtilities/Frameworks"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseAuth/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" "${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks" "${PODS_ROOT}/GoogleNetworkingUtilities/Frameworks" "${PODS_ROOT}/GoogleSymbolUtilities/Frameworks" "${PODS_ROOT}/GoogleUtilities/Frameworks"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) ${PODS_ROOT}/Firebase/Headers $(SDKROOT)/usr/include/libxml2 $(PODS_ROOT)/GDataXML-HTML/libxml $(SDKROOT)/usr/include/libxml2 $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AdSupport" -framework "AddressBook" -framework "Alamofire" -framework "Alamofire_SwiftyJSON" -framework "Bolts" -framework "CoreGraphics" -framework "FBSDKCoreKit" -framework "FBSDKLoginKit" -framework "FBSDKShareKit" -framework "FirebaseAnalytics" -framework "FirebaseAuth" -framework "FirebaseInstanceID" -framework "GDataXML_HTML" -framework "GoogleInterchangeUtilities" -framework "GoogleNetworkingUtilities" -framework "GoogleSymbolUtilities" -framework "GoogleUtilities" -framework "Locksmith" -framework "OAuthSwift" -framework "PicoKit" -framework "SafariServices" -framework "Security" -framework "StoreKit" -framework "SwiftyJSON" -framework "SystemConfiguration"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp/AeroGearHttp.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2/AeroGearOAuth2.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AdSupport" -framework "AddressBook" -framework "AeroGearHttp" -framework "AeroGearOAuth2" -framework "Alamofire" -framework "Alamofire_SwiftyJSON" -framework "Bolts" -framework "CoreGraphics" -framework "FBSDKCoreKit" -framework "FBSDKLoginKit" -framework "FBSDKShareKit" -framework "FirebaseAnalytics" -framework "FirebaseAuth" -framework "FirebaseInstanceID" -framework "GDataXML_HTML" -framework "GoogleInterchangeUtilities" -framework "GoogleNetworkingUtilities" -framework "GoogleSymbolUtilities" -framework "GoogleUtilities" -framework "Locksmith" -framework "OAuthSwift" -framework "PicoKit" -framework "SafariServices" -framework "Security" -framework "StoreKit" -framework "SwiftyJSON" -framework "SystemConfiguration"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

View File

@ -1,8 +1,8 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp/AeroGearHttp.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2/AeroGearOAuth2.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,8 +1,8 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp/AeroGearHttp.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2/AeroGearOAuth2.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,8 +1,8 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp/AeroGearHttp.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2/AeroGearOAuth2.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,8 +1,8 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp" "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON" "$PODS_CONFIGURATION_BUILD_DIR/Bolts" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit" "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit" "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML" "$PODS_CONFIGURATION_BUILD_DIR/Locksmith" "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift" "$PODS_CONFIGURATION_BUILD_DIR/PicoKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearHttp/AeroGearHttp.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/AeroGearOAuth2/AeroGearOAuth2.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire-SwiftyJSON/Alamofire_SwiftyJSON.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bolts/Bolts.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKCoreKit/FBSDKCoreKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKLoginKit/FBSDKLoginKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSDKShareKit/FBSDKShareKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GDataXML-HTML/GDataXML_HTML.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Locksmith/Locksmith.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OAuthSwift/OAuthSwift.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PicoKit/PicoKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAuth" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -9,28 +9,12 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/EtsyRESTAPIManager.swift"
timestampString = "486128108.896927"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.505474"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "57"
endingLineNumber = "57"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/EtsyRESTAPIManager.swift"
timestampString = "486128108.896927"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "66"
endingLineNumber = "66"
startingLineNumber = "73"
endingLineNumber = "73"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
</BreakpointContent>
@ -42,13 +26,93 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486128108.896927"
timestampString = "486227035.314411"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "43"
endingLineNumber = "43"
startingLineNumber = "27"
endingLineNumber = "27"
landmarkName = "FacebookGraphAPIManager"
landmarkType = "3">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.isAuthorized.getter : Swift.Bool"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.651867"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "27"
endingLineNumber = "27"
offsetFromSymbolStart = "11">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.init () -&gt; Vendoo.FacebookGraphAPIManager"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.652405"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "27"
endingLineNumber = "27"
offsetFromSymbolStart = "196">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227622.356175"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "59"
endingLineNumber = "59"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.authorizeApp (__ObjC.UIViewController) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.653326"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "59"
endingLineNumber = "59"
offsetFromSymbolStart = "1287">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.653483"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -57,14 +121,46 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "486180405.211327"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227622.356175"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "51"
endingLineNumber = "51"
landmarkName = "setNetworkSelectFunctionality(_:)"
startingLineNumber = "65"
endingLineNumber = "65"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.authorizeApp (__ObjC.UIViewController) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.654376"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "1382">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.654535"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -73,14 +169,46 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "486187285.19423"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227622.356175"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "104"
endingLineNumber = "104"
landmarkName = "tableView(_:cellForRowAtIndexPath:)"
startingLineNumber = "64"
endingLineNumber = "64"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.authorizeApp (__ObjC.UIViewController) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.655488"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "1382">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.655648"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -89,14 +217,46 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "486187285.19423"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227622.356175"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "402"
endingLineNumber = "402"
landmarkName = "tableView(_:didSelectRowAtIndexPath:)"
startingLineNumber = "63"
endingLineNumber = "63"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.authorizeApp (__ObjC.UIViewController) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.656601"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "1382">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.656721"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -105,29 +265,13 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "486187285.19423"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227898.081641"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "79"
endingLineNumber = "79"
landmarkName = "prepareForSegue(_:sender:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ItemImagePickerViewController.swift"
timestampString = "486187559.395902"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "60"
endingLineNumber = "60"
landmarkName = "prepareForSegue(_:sender:)"
startingLineNumber = "74"
endingLineNumber = "74"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>

View File

@ -10,7 +10,15 @@ import Foundation
import OAuthSwift
import FBSDKCoreKit
import FBSDKLoginKit
import AeroGearHttp
import AeroGearOAuth2
//import OAuthSwift
/*
NOTES:
I am able to authorize application for use with facebook but cannot deathorize and completion block of authorization code is not being called -> need to figure this out
*/
class FacebookGraphAPIManager: NSObject {
//API Manager class variables
@ -39,28 +47,65 @@ class FacebookGraphAPIManager: NSObject {
//MARK: - OAuth Methods
extension FacebookGraphAPIManager {
func authorizeApp(viewcontroller: UIViewController){
let oauthswift = OAuth2Swift(
consumerKey: self.apiKey,
consumerSecret: self.apiSecret,
authorizeUrl: "https://www.facebook.com/dialog/oauth",
accessTokenUrl: "https://graph.facebook.com/oauth/access_token",
responseType: "code"
)
let state: String = generateStateWithLength(20) as String
oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/vendoo")!, scope: "public_profile", state: state, success: {
credential, response, parameters in
let http = Http(baseURL: self.graphBaseURL) // [1]
let facebookConfig = FacebookConfig( // [2]
clientId: self.apiKey,
clientSecret: self.apiSecret,
scopes:["publish_actions"])
let oauth2Module = AccountManager.addFacebookAccount(facebookConfig) // [3]
http.authzModule = oauth2Module // [4]
//dispatch_async(dispatch_main(), <#T##block: dispatch_block_t##dispatch_block_t##() -> Void#>)
http.request(.GET, path: "/get", completionHandler: {
(response, error) in // [5]
// handle response
}, failure: { error in
print(error.localizedDescription, terminator: "")
//print(response)
/*if((error != nil)){
//once everything is authorized save true value to the authorization boolean
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "fbAuthorized")
self.isAuthorized = NSUserDefaults.standardUserDefaults().boolForKey("fbAuthorized")
}*/
})
//once everything is authorized save true value to the authorization boolean
// self.isAuthorized = oauth2Module.isAuthorized()
/*
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "etsyAuthorized")
self.isAuthorized = NSUserDefaults.standardUserDefaults().boolForKey("fbAuthorized")
*/
oauth2Module.revokeAccess({(response, error) in
if (error != nil) {
// do something with error
print("accessrevoked")
}
// do domething
})
*/
}
func deAuthorizeApp(viewcontroller: UIViewController){
let facebookConfig = FacebookConfig( // [2]
clientId: self.apiKey,
clientSecret: self.apiSecret,
scopes:["publish_actions"])
let oauth2Module = AccountManager.addFacebookAccount(facebookConfig) // [3]
oauth2Module.revokeAccess({(response, error) in
if (error != nil) {
// do something with error
}
// do domething
})
}
}

View File

@ -27,7 +27,7 @@
<string></string>
<key>CFBundleURLSchemes</key>
<array>
<string>vendoo</string>
<string>fb504150909777657</string>
</array>
</dict>
</array>