Skip to content

feat(api): Site wide token API - #22713

Merged
nijel merged 44 commits into
WeblateOrg:mainfrom
gersona:19951_site_wide_api
Nov 27, 2026
Merged

nijel merged 44 commits into
WeblateOrg:mainfrom
gersona:19951_site_wide_api

Conversation

@gersona

@gersona gersona commented Nov 9, 2026

Copy link
Copy Markdown
Member

fixes #19951

@accesslint accesslint Bot 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.

Found 4 issues across 3 rules (3 WCAG, 1 Best Practice).

Reviewed by AccessLint, which checks every pull request for accessibility issues.

@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

@nijel

nijel commented Nov 9, 2026

Copy link
Copy Markdown
Member

@codex review

@nijel nijel added this to the 2026.12 milestone Nov 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T18:41:46.895852Z b059255 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53858791d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/wladmin/views.py Resolved
Comment thread weblate/wladmin/forms.py Resolved
Comment thread weblate/wladmin/forms.py Resolved

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

@gersona
gersona marked this pull request as ready for review November 10, 2026 05:47
@gersona
gersona requested a review from nijel as a code owner November 10, 2026 05:47
@nijel

nijel commented Nov 10, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c15e69a295

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/accounts/utils.py Resolved
Comment thread weblate/auth/tasks.py Resolved

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

@nijel nijel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With 2026.11.2 released, we can push this forward. Can you please rebase/merge on current main branch. I've posted some review feedback as well.

Comment thread weblate/wladmin/forms.py Resolved
Comment thread weblate/accounts/utils.py Resolved

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

{% load crispy_forms_tags humanize i18n icons permissions translations %}

{% block breadcrumbs %}
<li class="breadcrumb-item">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WCAG 1.3.1: <li> is not contained in a <ul>, <ol>, or <menu>.

<li> elements must be contained in a <ul>, <ol>, or <menu>.

Details

List items (<li>) only have semantic meaning inside a list container (<ul>, <ol>, or <menu>). Without a list parent, screen readers will not announce 'list with N items' or allow users to skip between items using list navigation shortcuts. Wrap <li> elements in the appropriate list container — <ul> for unordered lists, <ol> for ordered/numbered lists.

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

{% load crispy_forms_tags humanize i18n icons permissions translations %}

{% block breadcrumbs %}
<li class="breadcrumb-item">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WCAG 1.3.1: <li> is not contained in a <ul>, <ol>, or <menu>.

<li> elements must be contained in a <ul>, <ol>, or <menu>.

Details

List items (<li>) only have semantic meaning inside a list container (<ul>, <ol>, or <menu>). Without a list parent, screen readers will not announce 'list with N items' or allow users to skip between items using list navigation shortcuts. Wrap <li> elements in the appropriate list container — <ul> for unordered lists, <ol> for ordered/numbered lists.

@nijel

nijel commented Nov 26, 2026

Copy link
Copy Markdown
Member

I merged with the current main, hopefully I didn't mess it up...

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de804a6d39

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/wladmin/views.py Resolved

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

{% load crispy_forms_tags humanize i18n icons permissions translations %}

{% block breadcrumbs %}
<li class="breadcrumb-item">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WCAG 1.3.1: <li> is not contained in a <ul>, <ol>, or <menu>.

<li> elements must be contained in a <ul>, <ol>, or <menu>.

Details

List items (<li>) only have semantic meaning inside a list container (<ul>, <ol>, or <menu>). Without a list parent, screen readers will not announce 'list with N items' or allow users to skip between items using list navigation shortcuts. Wrap <li> elements in the appropriate list container — <ul> for unordered lists, <ol> for ordered/numbered lists.

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

{% load crispy_forms_tags humanize i18n icons permissions translations %}

{% block breadcrumbs %}
<li class="breadcrumb-item">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WCAG 1.3.1: <li> is not contained in a <ul>, <ol>, or <menu>.

<li> elements must be contained in a <ul>, <ol>, or <menu>.

Details

List items (<li>) only have semantic meaning inside a list container (<ul>, <ol>, or <menu>). Without a list parent, screen readers will not announce 'list with N items' or allow users to skip between items using list navigation shortcuts. Wrap <li> elements in the appropriate list container — <ul> for unordered lists, <ol> for ordered/numbered lists.

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

{% load crispy_forms_tags humanize i18n icons permissions translations %}

{% block breadcrumbs %}
<li class="breadcrumb-item">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WCAG 1.3.1: <li> is not contained in a <ul>, <ol>, or <menu>.

<li> elements must be contained in a <ul>, <ol>, or <menu>.

Details

List items (<li>) only have semantic meaning inside a list container (<ul>, <ol>, or <menu>). Without a list parent, screen readers will not announce 'list with N items' or allow users to skip between items using list navigation shortcuts. Wrap <li> elements in the appropriate list container — <ul> for unordered lists, <ol> for ordered/numbered lists.

@nijel
nijel enabled auto-merge (squash) November 26, 2026 18:35
auto-merge was automatically disabled November 26, 2026 18:57

Head branch was pushed to by a user without write access

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

{% load crispy_forms_tags humanize i18n icons permissions translations %}

{% block breadcrumbs %}
<li class="breadcrumb-item">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WCAG 1.3.1: <li> is not contained in a <ul>, <ol>, or <menu>.

<li> elements must be contained in a <ul>, <ol>, or <menu>.

Details

List items (<li>) only have semantic meaning inside a list container (<ul>, <ol>, or <menu>). Without a list parent, screen readers will not announce 'list with N items' or allow users to skip between items using list navigation shortcuts. Wrap <li> elements in the appropriate list container — <ul> for unordered lists, <ol> for ordered/numbered lists.

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="weblate/api/views.py">

<violation number="1" location="weblate/api/views.py:1619">
P2: This guard protects only the groups action, so `user.edit` callers can still mutate or delete a site-token user through the ordinary user endpoint. Apply the site-token restriction to every mutating `UserViewSet` action, not only group membership changes.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread weblate/api/views.py
def groups(self, request: Request, **kwargs):
obj = self.get_object()
self.perm_check(request, obj, write=True)
if obj.is_site_api_token_bot:

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.

P2: This guard protects only the groups action, so user.edit callers can still mutate or delete a site-token user through the ordinary user endpoint. Apply the site-token restriction to every mutating UserViewSet action, not only group membership changes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At weblate/api/views.py, line 1619:

<comment>This guard protects only the groups action, so `user.edit` callers can still mutate or delete a site-token user through the ordinary user endpoint. Apply the site-token restriction to every mutating `UserViewSet` action, not only group membership changes.</comment>

<file context>
@@ -1611,6 +1616,14 @@ def perform_update(self, serializer) -> None:
     def groups(self, request: Request, **kwargs):
         obj = self.get_object()
         self.perm_check(request, obj, write=True)
+        if obj.is_site_api_token_bot:
+            self.permission_denied(
+                request,
</file context>

Comment thread weblate/wladmin/tests/test_sitetoken.py Resolved

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

{% load crispy_forms_tags humanize i18n icons permissions translations %}

{% block breadcrumbs %}
<li class="breadcrumb-item">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WCAG 1.3.1: <li> is not contained in a <ul>, <ol>, or <menu>.

<li> elements must be contained in a <ul>, <ol>, or <menu>.

Details

List items (<li>) only have semantic meaning inside a list container (<ul>, <ol>, or <menu>). Without a list parent, screen readers will not announce 'list with N items' or allow users to skip between items using list navigation shortcuts. Wrap <li> elements in the appropriate list container — <ul> for unordered lists, <ol> for ordered/numbered lists.

@nijel

nijel commented Nov 27, 2026

Copy link
Copy Markdown
Member

Please look at the merge conflicts.

@accesslint accesslint Bot 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.

Found 2 issues across 1 rule.

Reviewed by AccessLint, which checks every pull request for accessibility issues.

{% load crispy_forms_tags humanize i18n icons permissions translations %}

{% block breadcrumbs %}
<li class="breadcrumb-item">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WCAG 1.3.1: <li> is not contained in a <ul>, <ol>, or <menu>.

<li> elements must be contained in a <ul>, <ol>, or <menu>.

Details

List items (<li>) only have semantic meaning inside a list container (<ul>, <ol>, or <menu>). Without a list parent, screen readers will not announce 'list with N items' or allow users to skip between items using list navigation shortcuts. Wrap <li> elements in the appropriate list container — <ul> for unordered lists, <ol> for ordered/numbered lists.

@nijel
nijel merged commit 18d416c into WeblateOrg:main Nov 27, 2026
37 of 40 checks passed
@gersona
gersona deleted the 19951_site_wide_api branch November 28, 2026 11:16
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.

Site-wide API tokens

2 participants