Skip to content
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

Is API Name exist validation on UI failed in same tenant domain when having API with role based Publisher Access Control #2851

Closed
nadeepoornima opened this issue Apr 23, 2024 · 1 comment

Comments

@nadeepoornima
Copy link

Description

If we try to create an API with a duplicate name in the same tenant domain, its API name validation won't handle it properly if the existing API is created with role-based Publisher Access Control. Therefore, the API creator could try to make an API, but it will end up below the UI error, and API creation will fail.

Screenshot 2024-04-23 at 14 44 24

The expectation is that the API name should validate as already existing, but it won't enable the "create" button to create the API.

Steps to Reproduce

  1. Create a tenant called "wso2.com": [email protected] is the admin tenant user
  2. Create two tenant users under this "wso2.com" tenant as "[email protected]" and "[email protected]" via the management console by logging in as an admin tenant user.
  3. Create a role called "myrole" and assign it to the "[email protected]" tenant user.
  4. Log into the Publisher UI by using the "[email protected]".
  5. Create an API - name "ABC" and Restrict the Publisher Access Control with "my role".
Screenshot 2024-04-23 at 14 52 45
  1. Log into the Publisher UI using the "[email protected]".
  2. Next, try to create an API with an "ABC" name and a different context & version.
  3. The expectation is that the "ABC" name should be validated as already existing. But it won't happen and allow us to create the API.
  4. When clicking the "Create" button, it showed the below UI error as " Error::API Context does not exist". The reason is that when validating the API context, it detects there is no version for the given API name, provider and domain.
            "SELECT API_VERSION FROM AM_API WHERE API_NAME = ? AND API_PROVIDER = ? AND ORGANIZATION = ?";

Hence, "isValidContext()[]" is false, and the above error is thrown.
Screenshot 2024-04-23 at 14 44 24

[1]. https://github.com/wso2-support/carbon-apimgt/blob/a469ed282ffecbc7f88f8ae66f60c28a47d1299f/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java#L6606

Affected Component

APIM

Version

4.2.0

Environment Details (with versions)

Latest update level: All in one APIM with multiple tenant domiansAll-in-one

Relevant Log Output

ERROR - GlobalThrowableMapper 900977:Block Condition Error::API Context does not exist

Related Issues

No response

Suggested Labels

No response

@RakhithaRR
Copy link

Fixed with wso2/carbon-apimgt#12495 and wso2/apim-apps#716

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants