23
23
24
24
import Foundation
25
25
26
- open class OhhAuth
26
+ public class OhhAuth
27
27
{
28
28
/// Tuple to represent signing credentials. (consumer as well as user credentials)
29
29
public typealias Credentials = ( key: String , secret: String )
@@ -41,7 +41,7 @@ open class OhhAuth
41
41
/// - userCredentials: user credentials (nil if this is a request without user association)
42
42
///
43
43
/// - Returns: OAuth HTTP header entry for the Authorization field.
44
- open static func calculateSignature( url: URL , method: String , parameter: [ String : String ] ,
44
+ static func calculateSignature( url: URL , method: String , parameter: [ String : String ] ,
45
45
consumerCredentials cc: Credentials , userCredentials uc: Credentials ? ) -> String
46
46
{
47
47
typealias Tup = ( key: String , value: String )
@@ -99,7 +99,7 @@ open class OhhAuth
99
99
/// - Parameter paras: url-form parameters
100
100
/// - Parameter encoding: used string encoding (default: .utf8)
101
101
/// - Returns: correctly percentage encoded url-form parameters
102
- open static func httpBody( forFormParameters paras: [ String : String ] , encoding: String . Encoding = . utf8) -> Data ?
102
+ static func httpBody( forFormParameters paras: [ String : String ] , encoding: String . Encoding = . utf8) -> Data ?
103
103
{
104
104
let trans : ( String , String ) -> String = { k, v in
105
105
return rfc3986encode ( k) + " = " + rfc3986encode( v)
@@ -154,7 +154,7 @@ public extension URLRequest
154
154
/// - paras: url-form parameters
155
155
/// - consumerCredentials: consumer credentials
156
156
/// - userCredentials: user credentials (nil if this is a request without user association)
157
- public mutating func oAuthSign( method: String , urlFormParameters paras: [ String : String ] ,
157
+ mutating func oAuthSign( method: String , urlFormParameters paras: [ String : String ] ,
158
158
consumerCredentials cc: OhhAuth . Credentials , userCredentials uc: OhhAuth . Credentials ? = nil )
159
159
{
160
160
self . httpMethod = method. uppercased ( )
@@ -182,7 +182,7 @@ public extension URLRequest
182
182
/// - contentType: HTTP header "Content-Type" entry (default: nil)
183
183
/// - consumerCredentials: consumer credentials
184
184
/// - userCredentials: user credentials (nil if this is a request without user association)
185
- public mutating func oAuthSign( method: String , body: Data ? = nil , contentType: String ? = nil ,
185
+ mutating func oAuthSign( method: String , body: Data ? = nil , contentType: String ? = nil ,
186
186
consumerCredentials cc: OhhAuth . Credentials , userCredentials uc: OhhAuth . Credentials ? = nil )
187
187
{
188
188
self . httpMethod = method. uppercased ( )
0 commit comments