Skip to content

feat(users): add support for current user OAuth applications - #3458

Open
flynn-eye wants to merge 1 commit into
python-gitlab:mainfrom
flynn-eye:codex/current-user-applications
Open

flynn-eye wants to merge 1 commit into
python-gitlab:mainfrom
flynn-eye:codex/current-user-applications

Conversation

@flynn-eye

Copy link
Copy Markdown

Changes

GitLab 19.0 added a User Applications API (/user/applications) for OAuth applications owned by the authenticated user. python-gitlab only maps the instance-wide /applications endpoint, so these could not be managed without a custom manager (see #3451).

This adds CurrentUserApplication / CurrentUserApplicationManager, exposed as gl.user.applications, following the existing gl.user.emails / gl.user.keys pattern:

  • create requires name, redirect_uri, scopes; optional confidential
  • list, get, delete
  • update / save() with optional name and scopes
gl.auth()
app = gl.user.applications.create(
    {"name": "my_app", "redirect_uri": "http://app.url", "scopes": "read_user"}
)
app.name = "renamed"
app.save()
app.delete()

The manager is also picked up by the CLI as gitlab current-user-application {list,get,create,update,delete}.

Closes #3451

Documentation and testing

  • Documentation in the matching docs section (docs/gl_objects/users.rst)
  • Unit tests (tests/unit/objects/test_current_user_applications.py; create and update assert the request JSON body)

Locally: pytest tests/unit (727 passed, 3 skipped), black, isort, flake8, mypy, pylint on gitlab/, the rst pre-commit hooks, and sphinx-build -n -W all pass. I did not run the functional tests against a live GitLab 19 instance.

Add CurrentUserApplicationManager for the GitLab 19.0 User Applications
API (/user/applications), exposed as gl.user.applications.

Closes python-gitlab#3451

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.79%. Comparing base (8daa940) to head (b0b82bc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3458   +/-   ##
=======================================
  Coverage   95.78%   95.79%           
=======================================
  Files         100      100           
  Lines        6172     6180    +8     
=======================================
+ Hits         5912     5920    +8     
  Misses        260      260           
Flag Coverage Δ
api_func_v4 83.81% <100.00%> (-0.05%) ⬇️
cli_func_v4 78.81% <100.00%> (+0.02%) ⬆️
unit 90.33% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
gitlab/v4/objects/users.py 98.83% <100.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

Missing API endpoints for user OAuth applications

1 participant