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

docs: clarify different types of API access #535

Merged
merged 6 commits into from
Dec 17, 2024

Conversation

dwilding
Copy link
Contributor

@dwilding dwilding commented Dec 16, 2024

The purpose of this PR is make it easier to understand details about API security. (I'll create a separate PR to add a general security overview doc)

Summary of changes:

  • Specify which API endpoints have which access level
  • Use terms more consistently:
    • "Authenticated" to mean a user with read or admin access level
    • "Unauthenticated" to mean a user with untrusted access level
    • "Open-access" to mean an API endpoint that doesn't require authentication (instead of calling them "untrusted")

Preview build: https://canonical-pebble--535.com.readthedocs.build/en/535/

@dwilding dwilding changed the title docs: add more details related to security docs: clarify different types of API access Dec 16, 2024
@dwilding dwilding marked this pull request as ready for review December 16, 2024 03:21
Copy link
Contributor

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Approving, but a couple of tweaks suggested.

docs/explanation/api-and-clients.md Show resolved Hide resolved
* `read`: these are allowed from any authenticated user, regardless of access level. They are usually read operations that use the HTTP `GET` method, such as listing services or viewing notices.
* `admin`: these are only allowed from admin users. They are usually write or modify operations that use the HTTP `POST` method, such as adding a layer or starting a service.
* **Open-access** - Allowed from any user, even unauthenticated users using the HTTP-over-TCP listener.
* `GET /v1/system-info`, which returns the Pebble version and an identifier for the daemon
Copy link
Contributor

Choose a reason for hiding this comment

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

It's actually an identifier for this specific boot. Could just say "Pebble version and other information", and leave details to Tiexin's API page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed - thanks!

* `admin`: these are only allowed from admin users. They are usually write or modify operations that use the HTTP `POST` method, such as adding a layer or starting a service.
* **Open-access** - Allowed from any user, even unauthenticated users using the HTTP-over-TCP listener.
* `GET /v1/system-info`, which returns the Pebble version and an identifier for the daemon
* `GET /v1/health`, which returns a boolean to indicate the state of Pebble's health checks
Copy link
Contributor

Choose a reason for hiding this comment

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

To make the meaning of true clearer:

Suggested change
* `GET /v1/health`, which returns a boolean to indicate the state of Pebble's health checks
* `GET /v1/health`, which returns a boolean to indicate whether Pebble's health checks are all healthy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed - thanks!

docs/explanation/api-and-clients.md Show resolved Hide resolved
@dwilding dwilding merged commit 6372a42 into canonical:master Dec 17, 2024
18 checks passed
@dwilding dwilding deleted the more-security-info branch December 17, 2024 01:33
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