product-definition-center / pdc-ruby-gem

PDC Ruby Gem
MIT License
1 stars 7 forks source link

Defer fetching of token to first request. #11

Closed ycheng-aa closed 8 years ago

ycheng-aa commented 8 years ago

Fetching token in first restful api request, not in the configuration itself.

JIRA: PDC-1683

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.09%) to 98.628% when pulling 85c8b42c14c5f63df3bcf475914949d6e27f205a on PDC-1683_defer_fetching_of-token into 0c426fbd302513e7daed7803ab6ae12407a63452 on master.

sthaha commented 8 years ago

I think a better way to deal with token setting/fetching is to write a faraday middleware instead it being handled by config.rb and rest_api.rb files. IMHO this concern must be delegated to a middleware.

ycheng-aa commented 8 years ago

I will finally squash all commits to one before merge to master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.4%) to 98.274% when pulling d3a561cf175a823d05247877154a29551e74a34e on PDC-1683_defer_fetching_of-token into 0c426fbd302513e7daed7803ab6ae12407a63452 on master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.4%) to 98.274% when pulling 56e63d2203c63062e695e354a4212a8a70276a1e on PDC-1683_defer_fetching_of-token into 0c426fbd302513e7daed7803ab6ae12407a63452 on master.

sthaha commented 8 years ago

Few suggestions, mainly managing the PDC and Middleware tight-coupling

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.4%) to 98.297% when pulling 44cb56fc6b9b3099064cf2d6523d227f85784729 on PDC-1683_defer_fetching_of-token into 0c426fbd302513e7daed7803ab6ae12407a63452 on master.

sthaha commented 8 years ago

@ycheng-aa I have simplified the implementation by making the TokenFetcher only fetch token and not cache it and add a middleware that accepts arguments related to token in pull-request: #12

Could we close this and continue the discussion there?

ycheng-aa commented 8 years ago

Sure. Close it.