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

Add /operations endpoint to list available operations #17

Closed
wants to merge 2 commits into from

Conversation

Boolean263
Copy link

This is a straightforward change to add a /operations endpoint which
can be used to get a list of the available operations on the CyberChef
server. The returned object has an attribute for each operation name,
with the argument description as its value.

This change also documents this new endpoint in README.md and
swagger.yml.

This is a straightforward change to add a `/operations` endpoint which
can be used to get a list of the available operations on the CyberChef
server. The returned object has an attribute for each operation name,
with the argument description as its value.

This change also documents this new endpoint in `README.md` and
`swagger.yml`.
Copy link
Member

@d98762625 d98762625 left a comment

Choose a reason for hiding this comment

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

This is great, thank you @Boolean263.

Could you please address:

  • Minor documentation comments inline
  • Add some tests covering the output of your new endpoint (basic "it exists" and maybe the existence of a couple of operation properties)

Much appreciated, thanks a lot 🙌

@@ -48,7 +48,7 @@ A Docker image can be built, then run by doing the following:
## API overview
> For full documentation of the API, you can find the swagger page hosted at the root url. See [Installing](#Installing) to run the application and browse the docs.

Currently the server just has one endpoint: `/bake`. This endpoint accepts a POST request with the following body:
The most important endpoint is `/bake`. This endpoint accepts a POST request with the following body:
Copy link
Member

Choose a reason for hiding this comment

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

Could you make this part of the README a list of endpoints with anchor tags to their respective parts of the documentation please?

@@ -160,6 +160,52 @@ Response:
}
```

There is also a `/operations` endpoint. This endpoint accepts a GET request and responds with a JSON object listing the available operations on this server. Each operation name is one attribute, and its value is the description of the arguments it can take.

#### Example: operation list
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a section for /operations and put this example under it please

/**
* operationsGet
*/
router.get("/", async (req, res, next) => {
Copy link
Member

Choose a reason for hiding this comment

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

a bit of a nit: please could you make this function a function rather than an arrow function, just for consistency please.

type: object
example: >
{
"FromBase64" : {
Copy link
Member

Choose a reason for hiding this comment

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

Please can you define the example response in YAML rather than a string that looks like JSON please. there should be an example of this in swagger.yml now that the magic operation docs are included

@Boolean263
Copy link
Author

I got all your requested changes done, but I couldn't cleanly rebase my changes on master because of other changes you've made. I've set up a fresh pull request (#22) instead.

@Boolean263 Boolean263 closed this Jun 26, 2020
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.

2 participants