Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: admin REST API to be enabled only if config is set #2218

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

chaitanyaprem
Copy link
Contributor

Description

Admin REST API was enabled even if restadmin flag was set to false.

Note: Tested by running node locally and enabling/disabling the config flag to verify the availability of Admin REST API.

Changes

  • Included config check before installing Admin REST API handlers

Copy link

github-actions bot commented Nov 15, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2218

Built from b22cdc4

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

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

I have some generic thoughts on this PR.
One littel, and yes it is a general notice to myself also as me also running into this time-to-time. It is better avoid general formatting changes when having a fix PR. Maybe you have some auto-formatting enabled, idk. But it makes harder to find and review the meaningful change.

On the topic of the PR.
I think this change is opposed to #2137
Also it might be my fault and did not checked with enough care those cli switches, but did not expect that for a generic endpoint like admin (and health, debug, ...) we need such distinction. It is ok that some endpoint not mounted as the underlying feature not present (lightpush, filter,...).
So I think in general we can have /admin by default if having --rest=true.

@jm-clius , @fryorcraken : WDYT?

@chaitanyaprem
Copy link
Contributor Author

I have some generic thoughts on this PR.
One littel, and yes it is a general notice to myself also as me also running into this time-to-time. It is better avoid general formatting changes when having a fix PR. Maybe you have some auto-formatting enabled, idk. But it makes harder to find and review the meaningful change.

On the topic of the PR.
I think this change is opposed to #2137
Also it might be my fault and did not checked with enough care those cli switches, but did not expect that for a generic endpoint like admin (and health, debug, ...) we need such distinction. It is ok that some endpoint not mounted as the underlying feature not present (lightpush, filter,...).
So I think in general we can have /admin by default if having --rest=true.

@jm-clius , @fryorcraken : WDYT?

Sorry, did not realise my IDE did all changes.
Let me revert and only push the 2 lines change I actually did.

@NagyZoltanPeter
Copy link
Contributor

I have some generic thoughts on this PR.
One littel, and yes it is a general notice to myself also as me also running into this time-to-time. It is better avoid general formatting changes when having a fix PR. Maybe you have some auto-formatting enabled, idk. But it makes harder to find and review the meaningful change.
On the topic of the PR.
I think this change is opposed to #2137
Also it might be my fault and did not checked with enough care those cli switches, but did not expect that for a generic endpoint like admin (and health, debug, ...) we need such distinction. It is ok that some endpoint not mounted as the underlying feature not present (lightpush, filter,...).
So I think in general we can have /admin by default if having --rest=true.
@jm-clius , @fryorcraken : WDYT?

Sorry, did not realise my IDE did all changes. Let me revert and only push the 2 lines change I actually did.
Yeah I thought that was... :-)
You don't need I think. I found the relevant changes.

@fryorcraken
Copy link
Collaborator

I have no opinion on the matter as we are yet to understand how node operator would (or would not) use the REST API.
If anything, I'd say default to false to avoid one exposing the admin API by mistake

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this @chaitanyaprem !
Just asking for changes to reduce its scope and avoid the automatic IDE changes.

From my point of view I think is fine to have the admin enabled by default. Although I understand this PR is aimed to allow disabling it if needed.

Thanks again, and I'll re-check once the PR is simplified.
Cheers

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks so much indeed!

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@chaitanyaprem chaitanyaprem merged commit 110de90 into master Nov 24, 2023
9 of 10 checks passed
@chaitanyaprem chaitanyaprem deleted the fix/admin-rest-conf branch November 24, 2023 09:13
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.

None yet

5 participants