Closed jsmestad closed 6 years ago
I'd been using the great json_api_client gem, which appears to be unmaintained and has quite a few bugs that need to be patched.
In an effort to keep this project going, I have re-purposed jsonapi-consumer to continue on with the development.
jsonapi-consumer
Dynamic attribute definitions improvement (PR chingor13/json_api_client#281)
Before:
user system total real read: 1.090000 0.010000 1.100000 ( 1.091464) write: 1.130000 0.000000 1.130000 ( 1.136750)
After:
user system total real read: 0.020000 0.000000 0.020000 ( 0.016366) write: 0.690000 0.000000 0.690000 ( 0.687914)
JSONAPI::Consumer::Resource.authorize_with=
Authorization=Bearer #{val}
JSONAPI::Consumer::Resource.authorize_with(jwt, &block)
JSONAPI::Consumer::Resource.authorized?
JSONAPI::Consumer::Resource.clear_authorization!
JSONAPI::Consumer::Resource.authorized_as
Background
I'd been using the great json_api_client gem, which appears to be unmaintained and has quite a few bugs that need to be patched.
In an effort to keep this project going, I have re-purposed
jsonapi-consumer
to continue on with the development.Changes
Performance
Dynamic attribute definitions improvement (PR chingor13/json_api_client#281)
Before:
After:
Features
JSONAPI::Consumer::Resource.authorize_with=
setsAuthorization=Bearer #{val}
headerJSONAPI::Consumer::Resource.authorize_with(jwt, &block)
same as above, but for only a single request.JSONAPI::Consumer::Resource.authorized?
returns true/false if Authorization is not emptyJSONAPI::Consumer::Resource.clear_authorization!
clears the Authorization headerJSONAPI::Consumer::Resource.authorized_as
returns the Authorization headerBugfixes