Coder Social home page Coder Social logo

timberjack's People

Contributors

andrewjackman avatar andysmart avatar readmecritic avatar szehnder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

timberjack's Issues

Timberjack overwrites custom header fields and user agent

We set custom header fields on the default session configuration which Timberjack removes

To reproduce create a manager in the following way:

class HTTPManager: Manager {
    static let sharedManager: HTTPManager = {
        let configuration = Timberjack.defaultSessionConfiguration()
        let version = NSBundle.mainBundle().infoDictionary!["CFBundleVersion"] as! String
        let release = NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"] as! String

        let device = UIDevice.currentDevice()

        configuration.HTTPAdditionalHeaders = [
            "User-Agent": "AppName iOS \(release)/\(version); \(device.systemName) \(device.systemVersion))",
            "X-Device-Id": "Some generated ID"
        ]

        let manager = HTTPManager(configuration: configuration)
        return manager
    }()
}

The received request looks like this:

POST /v1/event HTTP/1.1
Host: localhost:3000
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Connection: keep-alive
Accept: */*
User-Agent: AppName/54 CFNetwork/711.4.6 Darwin/15.4.0
Content-Length: 81
Accept-Language: en-us
Accept-Encoding: gzip, deflate

The expected header should look like this:

POST /v1/event HTTP/1.1
Host: localhost:3000
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Connection: keep-alive
X-Device-Id: Some generated ID
Accept: */*
User-Agent: AppName iOS 0.6.0/54; iPhone OS 8.4)
Content-Length: 81
Accept-Language: en-us
Accept-Encoding: gzip, deflate

Swift 3 version would be so nice !

As Swift 3 is out, a compatible version of EVURLCache would be nice.
For the moment I embed the lib in my project and convert it to Swift 3.

Alamofire Manager initialisation with Timberjack configuration and serverTrustPolicyManager not working

I'm having a problem integrating this with my custom Alamofire Manager. I currently construct the Manager like this:

private let manager = Alamofire.Manager(serverTrustPolicyManager: ServerTrustPolicyManager(policies: [
    "api.example.com": .PerformDefaultEvaluation(validateHost: true),
    "dev.api.example.com": .PerformDefaultEvaluation(validateHost: false),
    "staging.api.example.com": .PerformDefaultEvaluation(validateHost: false)
]))

and my wildcard SSL certificate hostname verification is ignored on the dev.api and staging.api subdomains.

As soon as I add the configuration to support Timberjack logging to the Manager.init like this:

private let manager = Alamofire.Manager(configuration: Timberjack.defaultSessionConfiguration(), serverTrustPolicyManager: ServerTrustPolicyManager(policies: [
    "api.example.com": .PerformDefaultEvaluation(validateHost: true),
    "dev.api.example.com": .PerformDefaultEvaluation(validateHost: false),
    "staging.api.example.com": .PerformDefaultEvaluation(validateHost: false)
]))

the default serverTrustPolicyManager seems to be used, and my SSL handshake with dev.api and staging.api fail, because they don't match the *.example.com SSL certificate hostname. It's like something is overwriting my ServerTrustPolicyManager.

Any ideas?

swift 3.2

Which version of Timberjack I should include to my project? (Swift 3.2)

I set up version number 0.0.2, but actually when I build my project there are a lot of errors. How can solve this issue? Thanks.

No such Module 'Timberjack'

I used your lib for days, after that it just stopped working, always getting error: No such Module 'Timberjack'. I even uninstalled Xcode 8 and cocapods together with my project, installed everything again and it's still not working. I love it, but just cannot make it work.
Do you have some clue what might be going on?

Timberjack is preventing App Store submission

I am not able to submit my app to app store. Getting following error:

Error 1:
ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'MyApp.app/Frameworks/Timberjack.framework/libswiftRemoteMirror.dylib' is not permitted. Your app can’t contain standalone executables or libraries, other than the CFBundleExecutable of supported bundles.

Error 2:
ERROR ITMS-90206: "Invalid Bundle. The bundle at 'MyApp.app/Frameworks/Timberjack.framework' contains disallowed file 'Frameworks'."

I have integrated Timberjack through Carthage.
Carthage: 0.24.0
Timberjack: 0.0.3
Xcode: 8.3.3

Feature: Support SSL pinning

Right now Timberjack isn't handling the requirements for SSL pinning / validation (see #3).

It would be nice if this can be bundled in, or at least documented - while keeping things lightweight.

SIGSEGV segmentation fault when accessing default Timberjack session configuration

I am seeing a crash (SIGSEGV - invalid memory address) in the following code when calling the Alamofire HTTPManager and passing the results of a call to the Timberjack.defaultSessionConfiguration():

class HTTPManager: Alamofire.SessionManager {

static let shared: HTTPManager = {
    let configuration = Timberjack.defaultSessionConfiguration()
    let manager = HTTPManager(configuration: configuration) . <=== Crashes here
    return manager
}()

}

The is following the example in the Timberjack README file (https://github.com/andysmart/Timberjack)

And our network calls look like this:

class DataAgent: NSObject, NSCoding {

public static var manager:NetworkManager = NetworkManager()

let request:DataRequest = manager.networkRequest("(DataAgent.api_url)", method:NetworkingConstants.HTTPMethod.post, params: params)
request.validate()
.responseJSON { response in
switch response.result {
case .success(let data):
DataAgent.tokenCallback(json: JSON(data))
DataAgent.scope = role
print("Login Successful! (DataAgent.access_token ?? "UNDEFINED")")
completion(true)

                    case .failure(let error):
                        print("Login Failed: \(error)")
                        completion(false)
                }
            }

And the network request is in my NetworkManager class:

func networkRequest<T> (_ url:String, method:NetworkingConstants.HTTPMethod, params:[String : Any], mock:Bool = false) -> T  {
       ...
        let parameters:Parameters = params
        let returnRequest:DataRequest = HTTPManager.shared.request(url, method: getAlamofireMethod(method), parameters: parameters)
        return returnRequest as! T
      ...
}

But I am not able to reproduce this one on-demand but am seeing that my users are experiencing it.

Cocoapods Tag is outdated

It seems Cocoapods is serving the old tag (0.0.2). Would be great if it can be updated to the latest (0.0.3) with Swift3 compatibility. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.