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

Make all services and groups available via the API (#69) #210

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Kovah
Copy link

@Kovah Kovah commented Jan 30, 2023

I think this is a needed fix, because external services or scripts should have access to all data. If there is a use case where an API token should not access private data, different token permissions should probably be implemented.

I tested this the following way:

  • Created a clean setup with demo data.
  • Added a new test user.
  • Logged in with both users, both can view private services and groups on the dashboard.
  • Anonymous users can not view private services or groups on the dashboard.
  • When authenticated with an API token, private services and groups are now displayed properly.

Of course, this should be pointed out in the release notes.


Testing locally can be done by building the binary. With Go and Node installed, run make build. Then start Statping with ./statping.
API testing can be done by setting an API secret right before starting Statping with export API_SECRET=super-secret-token. In a tool like Insomnia, you can point to http://localhost:8080/api/services with the secret as a Bearer token.

@adamboutcher
Copy link
Collaborator

I dont use the API, so I'm not sure what this changes exactly but your reasoning seems sensible to me...

@adamboutcher adamboutcher added the Improvement An Improvement of an already implemented feature label Jul 12, 2023
@jemand771
Copy link
Member

jemand771 commented Jul 12, 2023

changes lgtm, but the (existing) api authentication handling is a bit confusing to me (i.e. who can see and/or modify which resources) - I'll have to look into that soon™

closing and reopening for now to (hopefully) trigger ci 👀

@jemand771 jemand771 closed this Jul 12, 2023
@jemand771 jemand771 reopened this Jul 12, 2023
@a-camacho
Copy link

Any news when this PR can be merged ?
Thanks a lot !

@larswmh
Copy link

larswmh commented Oct 12, 2023

Would also really appreciate if this could be implemented, thanks

@a-camacho
Copy link

Would also really appreciate if this could be implemented, thanks

Any news ?
Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement An Improvement of an already implemented feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants