Skip to content

Add support for IAM Auth and LTv3 #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 22, 2018
Merged

Conversation

mkistler
Copy link

This PR adds support for Watson services that use IAM authentication. It also replaces the Language Translator V2 service with Language Translator V3.

The code in this PR is not yet fully tested, but I wanted to get feedback on these changes before going further.

@@ -215,7 +248,9 @@ public ToneAnalyzer toneAnalyzer() {
public VisualRecognition visualRecognition() {
VisualRecognition service = new VisualRecognition(vrConfig.getVersionDate());
configUrl(service, vrConfig);
configBasicAuth(service, vrConfig);
if (!configBasicAuth(service, vrConfig)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this line need to check for configApiKey()?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I think it does. And actually I think I will flip all these tests around to check for IAM first, and only when it is not provided to use the "legacy" auth. That will be a smaller code change.

@lpatino10
Copy link
Contributor

Other than one comment I think it looks good so far 👍

@mkistler mkistler requested a review from BarDweller June 19, 2018 21:33
@codecov-io
Copy link

codecov-io commented Jun 19, 2018

Codecov Report

Merging #9 into master will increase coverage by 1.35%.
The diff coverage is 96.55%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master       #9      +/-   ##
============================================
+ Coverage      96.8%   98.16%   +1.35%     
- Complexity       41       46       +5     
============================================
  Files            13       14       +1     
  Lines            94      109      +15     
  Branches          5        6       +1     
============================================
+ Hits             91      107      +16     
+ Partials          3        2       -1
Impacted Files Coverage Δ Complexity Δ
...g/boot/WatsonAssistantConfigurationProperties.java 100% <100%> (ø) 1 <1> (?)
...oud/spring/boot/WatsonConfigurationProperties.java 100% <100%> (ø) 13 <2> (+2) ⬆️
...per_cloud/spring/boot/WatsonAutoConfiguration.java 98.43% <100%> (+2.07%) 18 <6> (+2) ⬆️
...oper_cloud/spring/boot/WatsonServiceCondition.java 93.33% <66.66%> (+1.02%) 4 <0> (ø) ⬇️

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 90da5fe...999877a. Read the comment docs.

@mkistler
Copy link
Author

Test for IAM auth has been added so I have removed the do not merge label.

@mkistler
Copy link
Author

@lpatino10 @BarDweller I think this is ready to go. If one of you approve I will go ahead and merge.

@germanattanasio germanattanasio merged commit 4ad4092 into master Jun 22, 2018
@germanattanasio germanattanasio deleted the mdk/iam-support branch June 22, 2018 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants