IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

New Authentication mechanism #21

Closed ehdsouza closed 5 years ago

ehdsouza commented 5 years ago

This PR supports

assistant = AssistantV1(version='2018-07-10', authenticator=BasicAuthenticator('', ''))

* removed older python versions from travis
* moved all code for `get_authenticator_from_environment` in utils file
* The base service has `request` is broken up into: `prepare_request` and `send`. So the generator would be updated to:
    request = self.prepare_request(
        method='GET',
        url=url,
        headers=headers,
        params=params,
        accept_json=True)
    response = self.send(request)

Also updated the design doc: https://github.ibm.com/CloudEngineering/openapi-sdkgen/wiki/Core-SDK-Authentication-Design
codecov[bot] commented 5 years ago

Codecov Report

Merging #21 into next will increase coverage by 2%. The diff coverage is 97.81%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next      #21   +/-   ##
=======================================
+ Coverage   95.75%   97.76%   +2%     
=======================================
  Files           9       16    +7     
  Lines         448      492   +44     
=======================================
+ Hits          429      481   +52     
+ Misses         19       11    -8
Impacted Files Coverage Δ
...oud_sdk_core/authenticators/basic_authenticator.py 100% <100%> (ø)
...loud_sdk_core/authenticators/cp4d_authenticator.py 100% <100%> (ø)
ibm_cloud_sdk_core/iam_token_manager.py 100% <100%> (ø) :arrow_up:
..._core/authenticators/bearer_token_authenticator.py 100% <100%> (ø)
ibm_cloud_sdk_core/jwt_token_manager.py 97.72% <100%> (-0.32%) :arrow_down:
ibm_cloud_sdk_core/authenticators/__init__.py 100% <100%> (ø)
ibm_cloud_sdk_core/cp4d_token_manager.py 100% <100%> (ø)
ibm_cloud_sdk_core/__init__.py 100% <100%> (ø) :arrow_up:
...d_sdk_core/authenticators/no_auth_authenticator.py 100% <100%> (ø)
ibm_cloud_sdk_core/authenticators/authenticator.py 66.66% <66.66%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ed2147a...cec3609. Read the comment docs.

dpopp07 commented 5 years ago

Haven't looked at the code yet, but have a couple questions about the release strategy:

I see you're merging this into master, so will that trigger a release? Isn't this a breaking change? If this is going into the major release candidate for the core, perhaps it should go into a next branch or something like that.

That is, unless this is the only change you want to go into the next major release. If that's the case, we can just do the major release with this PR like @padamstx did with Java.

Either way, shouldn't one of the commit messages have the BREAKING CHANGE tag on it?

ehdsouza commented 5 years ago

@dpopp07 I changed the base to next as I would be making more minor changes like updating the request library. Together, Ill merge it as an official major 1.0.0 release

padamstx commented 5 years ago

@ehdsouza I haven't had a chance to look at the changes in detail yet, but could you add python code examples to the design wiki. That will likely help us a bit during the review, plus it would be good to have examples for all the languages on the wiki :)

watson-github-bot commented 5 years ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: