Skip to content

Improve OpenAPI, introduce Bruno collection#586

Open
byewokko wants to merge 2 commits into
mainfrom
docs/improve-openapi-with-ai
Open

Improve OpenAPI, introduce Bruno collection#586
byewokko wants to merge 2 commits into
mainfrom
docs/improve-openapi-with-ai

Conversation

@byewokko

@byewokko byewokko commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive API documentation collection covering tenants, roles, sessions, clients, passwords, and OpenID Connect flows.
    • Included ready-to-run requests for listing, creating, updating, retrieving, and deleting common admin resources.
    • Added examples, parameter defaults, pagination/filtering notes, and environment settings for local use.
    • Expanded endpoint descriptions with clearer request and response details for easier API exploration.

@byewokko byewokko self-assigned this Jul 2, 2026
@byewokko byewokko added the documentation Improvements or additions to documentation label Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a new Bruno API request collection under docs/bruno covering Clients, OAuth 2.0/OIDC, Passwords, Roles, Sessions, and Tenants endpoints, plus collection config and environment variables. It also expands OpenAPI-style docstrings in client, credentials, session, and tenant handlers without changing handler logic.

Changes

Bruno API collection

Layer / File(s) Summary
Collection config and environment
docs/bruno/bruno.json, docs/bruno/environments/localhost.bru
Adds the Bruno collection definition and local environment variables (BASE_URL, PUBLIC_URL).
Clients folder and requests
docs/bruno/Clients/*
Adds folder metadata and requests for registering, getting, listing, updating, and deleting clients.
OAuth 2.0 / OIDC folder and requests
docs/bruno/OAuth 2.0 OpenID Connect/*
Adds folder metadata plus discovery and token exchange (PKCE) requests.
Passwords folder and request
docs/bruno/Passwords/*
Adds folder metadata and a request for retrieving password policy.
Roles folder and requests
docs/bruno/Roles/*
Adds folder metadata and requests to create a role and list tenant roles.
Sessions folder and request
docs/bruno/Sessions/*
Adds folder metadata and a request to list active sessions.
Tenants folder and requests
docs/bruno/Tenants/*
Adds folder metadata and requests to list, search, create, get, update, and delete tenants.

Handler docstring documentation

Layer / File(s) Summary
Client and credentials handler docs
seacatauth/client/handler.py, seacatauth/credentials/handler.py
Expands docstrings for client registration and credentials list/get/create endpoints with examples and response codes.
Session handler docs
seacatauth/session/handler.py
Rewrites the session_list docstring with richer parameter schemas and response documentation.
Tenant handler docs
seacatauth/tenant/handler.py
Expands docstrings for tenant list, get, create, update, delete, assign, and unassign endpoints with examples and response codes.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested labels: documentation

Suggested reviewers: none


🐰 A rabbit hopped through docs anew,
Bruno files sprouted, request by request grew,
Tenants, clients, sessions in a row,
Docstrings blossomed with an OpenAPI glow,
No logic bent — just clearer paths to view.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: improved OpenAPI docs and a new Bruno collection.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/improve-openapi-with-ai

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@seacatauth/client/handler.py`:
- Around line 164-170: The register_client response documentation is missing the
404 branch for unknown providers, so update the response table to include the
provider-not-found case alongside the existing 200/400/403 entries. Use the
register_client handler and its provider lookup path as the reference point, and
make sure the documented status codes match the actual return values.

In `@seacatauth/credentials/handler.py`:
- Around line 410-436: Document the alternate `password_reset` response shape in
the credentials creation endpoint docs, since `handler.py` can return a 200 with
a `password_reset` error payload when `passwordlink` is enabled. Update the
response example and description near the existing create-credentials response
block to mention this envelope alongside the happy path, so clients know to
handle both outcomes from the same endpoint.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60f99263-946e-4756-9ae7-e3ea9b860f25

📥 Commits

Reviewing files that changed from the base of the PR and between 25938bd and 70f8cbe.

📒 Files selected for processing (29)
  • docs/bruno/Clients/Delete client.bru
  • docs/bruno/Clients/Get client.bru
  • docs/bruno/Clients/List clients.bru
  • docs/bruno/Clients/Register client.bru
  • docs/bruno/Clients/Update client.bru
  • docs/bruno/Clients/folder.bru
  • docs/bruno/OAuth 2.0 OpenID Connect/OIDC Discovery.bru
  • docs/bruno/OAuth 2.0 OpenID Connect/Token request.bru
  • docs/bruno/OAuth 2.0 OpenID Connect/folder.bru
  • docs/bruno/Passwords/Password policy.bru
  • docs/bruno/Passwords/folder.bru
  • docs/bruno/Roles/Create role.bru
  • docs/bruno/Roles/List tenant roles.bru
  • docs/bruno/Roles/folder.bru
  • docs/bruno/Sessions/List sessions.bru
  • docs/bruno/Sessions/folder.bru
  • docs/bruno/Tenants/Create tenant.bru
  • docs/bruno/Tenants/Delete tenant.bru
  • docs/bruno/Tenants/Get tenant.bru
  • docs/bruno/Tenants/List tenants.bru
  • docs/bruno/Tenants/Search tenants.bru
  • docs/bruno/Tenants/Update tenant.bru
  • docs/bruno/Tenants/folder.bru
  • docs/bruno/bruno.json
  • docs/bruno/environments/localhost.bru
  • seacatauth/client/handler.py
  • seacatauth/credentials/handler.py
  • seacatauth/session/handler.py
  • seacatauth/tenant/handler.py

Comment on lines +164 to +170
responses:
200:
description: Client registered successfully
400:
description: Invalid client metadata
403:
description: Insufficient permissions to register client

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document the 404 provider-not-found response.

register_client already returns 404 when the provider lookup fails, so the response table should include that branch; otherwise the contract is incomplete for unknown providers.

💡 Suggested doc update
 		responses:
 				description: Client registered successfully
 				description: Invalid client metadata
 				description: Insufficient permissions to register client
+			404:
+				description: Provider not found
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
responses:
200:
description: Client registered successfully
400:
description: Invalid client metadata
403:
description: Insufficient permissions to register client
responses:
200:
description: Client registered successfully
400:
description: Invalid client metadata
403:
description: Insufficient permissions to register client
404:
description: Provider not found
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@seacatauth/client/handler.py` around lines 164 - 170, The register_client
response documentation is missing the 404 branch for unknown providers, so
update the response table to include the provider-not-found case alongside the
existing 200/400/403 entries. Use the register_client handler and its provider
lookup path as the reference point, and make sure the documented status codes
match the actual return values.

Comment on lines +410 to +436
Example response:
```json
{
"result": "OK",
"status": "OK",
"_id": "mongodb:default:abc123def456",
"_type": "mongodb",
"_provider_id": "mongodb:default"
}
```
---
parameters:
- name: provider
in: path
description: ID of the credential provider to create the credentials in
required: true
schema:
type: string
responses:
200:
description: Credentials created successfully
400:
description: Invalid request data or credentials already exist
403:
description: Insufficient permissions to create credentials
404:
description: Provider not found

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document the password_reset response envelope.

This endpoint can return password_reset with an error payload while still responding 200. The current doc only shows the happy path, so clients won't know to handle the reset-link failure case.

💡 Suggested doc update
 		Example response:
 		```json
 		{
 			"result": "OK",
 			"status": "OK",
 			"_id": "mongodb:default:abc123def456",
 			"_type": "mongodb",
 			"_provider_id": "mongodb:default"
 		}
 		```
+		When `passwordlink` is enabled, the response may also include a `password_reset`
+		object with either success details or an error payload.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Example response:
```json
{
"result": "OK",
"status": "OK",
"_id": "mongodb:default:abc123def456",
"_type": "mongodb",
"_provider_id": "mongodb:default"
}
```
---
parameters:
- name: provider
in: path
description: ID of the credential provider to create the credentials in
required: true
schema:
type: string
responses:
200:
description: Credentials created successfully
400:
description: Invalid request data or credentials already exist
403:
description: Insufficient permissions to create credentials
404:
description: Provider not found
Example response:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@seacatauth/credentials/handler.py` around lines 410 - 436, Document the
alternate `password_reset` response shape in the credentials creation endpoint
docs, since `handler.py` can return a 200 with a `password_reset` error payload
when `passwordlink` is enabled. Update the response example and description near
the existing create-credentials response block to mention this envelope
alongside the happy path, so clients know to handle both outcomes from the same
endpoint.

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant