Skip to content

feat: implement mint_credential [FC-0144] - #35

Open
rpenido wants to merge 11 commits into
openedx:mainfrom
open-craft:rpenido/FAL-4409/tenant-token-api
Open

rpenido wants to merge 11 commits into
openedx:mainfrom
open-craft:rpenido/FAL-4409/tenant-token-api

Conversation

@rpenido

@rpenido rpenido commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Stacked PR: built on top of #34, which is not merged yet. Until it is, the files changed include #34's commits; this PR's own history starts at feat: implement mint_credential. #32 has merged.

Description

Implements mint_credential(use_case, scope, expires_in=DEFAULT_CREDENTIAL_LIFETIME), the consumer API for the scoped, expiring credential the browser uses to query the engine directly. The lifetime defaults to 30 minutes and can be overridden. It validates the CredentialScope and the lifetime, resolves the use case's registration and adapter, and delegates the engine-specific work.

The Meilisearch tenant token lands with #33, and Typesense scoped keys with #18.

The returned SearchCredential carries the public engine URL, the physical index name and the scoped key. The adapter owns the index name, and the public URL can differ from the connection URL, so the browser cannot derive either.

Testing instructions

  • Run the suite with uv run --group test pytest -q, and the linters with uv run tox -e quality.
  • The API is tested against a recording adapter; there is no engine implementation on this branch.

Additional Information

Depends on:

Used by:


Private ref: FAL-4409

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 25, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @rpenido!

This repository is currently maintained by @ormsbee.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Nov 25, 2026
@rpenido
rpenido requested a review from navinkarkera November 26, 2026 14:12
@rpenido
rpenido force-pushed the rpenido/FAL-4409/tenant-token-api branch from f165e1e to 5a0ae04 Compare December 1, 2026 13:55
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Dec 2, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Dec 2, 2026

@navinkarkera navinkarkera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rpenido Looks good.

@rpenido
rpenido force-pushed the rpenido/FAL-4409/tenant-token-api branch from 5a0ae04 to 0de48b1 Compare December 3, 2026 17:46

@bradenmacdonald bradenmacdonald left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There's not much here to review! It looks fine to me and we can refine it later.

Comment thread src/openedx_search/api.py Resolved
Comment thread src/openedx_search/api.py Resolved
@rpenido
rpenido force-pushed the rpenido/FAL-4409/tenant-token-api branch from 0de48b1 to 7130847 Compare December 4, 2026 21:14
SearchQuery carries the text, one bounded page and the same exact filter expression delete() accepts, including id equality and IN lists. api.search() resolves the registration and delegates to Adapter.search(), which the Meilisearch adapter implements against the live index with q, offset, limit and the rendered filter. count_only sends limit 0 so the migrator can count without transferring a page; the estimated total is never reported as exact.
The shared hit count validation it also carried belongs to the
Meilisearch adapter branch.
@rpenido
rpenido force-pushed the rpenido/FAL-4409/tenant-token-api branch from 7130847 to de4f5c9 Compare December 4, 2026 21:30
@rpenido
rpenido force-pushed the rpenido/FAL-4409/tenant-token-api branch from de4f5c9 to a603d61 Compare December 4, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

Python API to get a restricted tenant token

5 participants