Skip to content

Conversation

@mediumTaj
Copy link
Contributor

@mediumTaj mediumTaj commented May 25, 2018

Summary

This pull request removes apikey specific checks in the Visual Recognition abstraction. We set the endpoint of the visual recognition service if the user authenticates using apikey. Additionally, the default iamurl was revised to use the non region specific url. Finally, I added duplicated tests to run on CF and RC instances in Assistant and Visual Recognition. I commented out classifier creation and deletion in Visual Recognition because we are having issues with "ghost" classifiers. All tests pass locally.

@mediumTaj mediumTaj requested a review from mamoonraja May 25, 2018 20:48
{
ApiKey = apiKey;
Url = url;
Url = !string.IsNullOrEmpty(url) ? url : "https://gateway-a.watsonplatform.net/visual-recognition/api";
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's obvious, but why are we setting to https://gateway-a.watsonplatform.net/visual-recognition/api? How are we making sure that iam user will not end here?

Copy link
Contributor Author

@mediumTaj mediumTaj May 26, 2018

Choose a reason for hiding this comment

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

We set the gateway-a endpoint here If they authenticate with the old apikey. I guess we can try to stop IAM users from putting their iam apikey here. What do you think? Maybe check the length of the apikey and error if it is not the correct length? We have documentation to authenticate using IAM as well but I am open to suggestions

Copy link
Member

Choose a reason for hiding this comment

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

Aren't we getting the url from VCAP services even for IAM? Because credentials have url usually. Even if it's CF or RC.

screen shot 2018-05-31 at 12 05 56 pm

I don't remember what was the length for old cf api_key :( Maybe we can do that.

Copy link
Member

Choose a reason for hiding this comment

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

PR looks good otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we are, but we don't always use the url and use the default urls. We want to make sure that if they authenticate with apikey that the url goes to gateway-a

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but yes if you use the url provided in the credentials it should work either way

Copy link
Member

Choose a reason for hiding this comment

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

great. i am approving

@mediumTaj
Copy link
Contributor Author

Hey @mamoonraja can you review this one more time? I had to add more commits to this. I revised the description.

@mediumTaj mediumTaj merged commit 986364c into develop May 31, 2018
@mediumTaj mediumTaj deleted the 4586-support-cf-visualrecognition-instances branch May 31, 2018 17:59
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