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

Allow access to the tenant perspective APIs #298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShanChathusanda93
Copy link
Contributor

Proposed changes in this pull request

<OrgContextsToRewriteInTenantPerspective>
    <WebApp>
        <Context>
            <BasePath>/api/</BasePath>
            <SubPaths>
                <Path>/api/identity/oauth2/dcr/</Path>
            </SubPaths>
        </Context>
        <Context>
            <BasePath>/oauth2/</BasePath>
            <SubPaths>
                <Path>/oauth2/token</Path>
                <Path>/oauth2/introspect</Path>
            </SubPaths>
        </Context>
    </WebApp>
</OrgContextsToRewriteInTenantPerspective>
  • DCR endpoint will create the OAuth2 applications in the sub organization level
    • Path : /t/{tenant-domain}/o/{org-id}/api/identity/oauth2/dcr/v1.1/register
  • Token generation and introspection
    • Path : /t/{tenant-domain}/o/{org-id}/oauth2/token?scope=openid ...
  • When access tokens are handled the tokens will be handled from the sub organization level by checking the type of the application which are using the token service.

When should this PR be merged

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 3.66%. Comparing base (ae652ff) to head (3f84931).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##             master    #298   +/-   ##
========================================
  Coverage      3.66%   3.66%           
  Complexity       20      20           
========================================
  Files            36      36           
  Lines          1529    1529           
  Branches        254     254           
========================================
  Hits             56      56           
  Misses         1472    1472           
  Partials          1       1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.max(Comparator.comparingInt(rewriteContext -> rewriteContext.getContext().length()));
maybeOrgRewriteContext.ifPresent(
organizationRewriteContext -> organizationRewriteContext.addSubPath(
Pattern.compile("^/t/[^/]+/o/[a-f0-9\\-]+" + subPath)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Pattern.compile("^/t/[^/]+/o/[a-f0-9\\-]+" + subPath)));
Pattern.compile("^/t/[^/]+/o/[a-z0-9\\-]+" + subPath)));


private boolean isOrganizationIdAvailableInTenantPerspective(String requestURI) {

return Pattern.compile("^/t/[^/]+/o/[a-f0-9\\-]+?").matcher(requestURI).find();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return Pattern.compile("^/t/[^/]+/o/[a-f0-9\\-]+?").matcher(requestURI).find();
return Pattern.compile("^/t/[^/]+/o/[a-z0-9\\-]+?").matcher(requestURI).find();

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

Successfully merging this pull request may close these issues.

2 participants