Skip to content

Allow certificates endpoint only for Admin - #2919

Merged
renuka-fernando merged 1 commit into
wso2:mainfrom
VirajSalaka:scope-change
Jul 28, 2026
Merged

Allow certificates endpoint only for Admin#2919
renuka-fernando merged 1 commit into
wso2:mainfrom
VirajSalaka:scope-change

Conversation

@VirajSalaka

Copy link
Copy Markdown
Contributor

Purpose

Allow Certificates POST only for Admin

Goals

Describe what solutions this feature or fix introduces to address the problems outlined above.

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI. Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 38858128-00d2-4eb2-b15f-e5cff4f515d7

📥 Commits

Reviewing files that changed from the base of the PR and between 31f332f and e8781a4.

📒 Files selected for processing (3)
  • gateway/gateway-controller/api/management-openapi.yaml
  • gateway/gateway-controller/cmd/controller/main.go
  • gateway/gateway-controller/pkg/api/management/generated.go

📝 Walkthrough

Walkthrough

The certificate upload endpoint’s required basic-auth role changes from admin or developer to admin only. The controller’s default authorization mapping and embedded generated Swagger specification are updated accordingly; import ordering is also adjusted.

Changes

Certificate upload authorization

Layer / File(s) Summary
Admin-only certificate upload authorization
gateway/gateway-controller/api/management-openapi.yaml, gateway/gateway-controller/cmd/controller/main.go
The POST /certificates endpoint now maps exclusively to the admin role in the OpenAPI declaration and controller configuration; imports are reordered without logic changes.
Regenerated management Swagger specification
gateway/gateway-controller/pkg/api/management/generated.go
The embedded Swagger payload is regenerated to include the updated authorization declaration.

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

Suggested reviewers: anugayan, malinthaprasan, tharsanan1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning Only the Purpose section has real content; the required template sections are mostly left as placeholders. Fill in Goals, Approach, User stories, Documentation, tests, security checks, samples, related PRs, and test environment with concrete details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: restricting certificate uploads to Admin users.
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 unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies"


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.

@renuka-fernando
renuka-fernando merged commit 1637132 into wso2:main Jul 28, 2026
12 of 13 checks passed
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.

3 participants