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 /acl/policy.. + /acl/token.. endpoints support into ACL library #144

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

Conversation

happy-code-com
Copy link

No description provided.

@silas
Copy link
Owner

silas commented Mar 18, 2023

I took a first stab at writing some tests for this PR (and fixed various issues they uncovered), you can merge them from consul-acls branch if you want.

You should run npm test locally to ensure tests pass.

@silas
Copy link
Owner

silas commented Mar 18, 2023

In addition to getting npm test to pass, I generally like to manually test each call against a real server and add new methods to README docs. I can do the last two steps if you get the test passing.

@happy-code-com
Copy link
Author

Thank you very much! I'll add a description to the Readme and deal with the tests. I will also add the processing of additional keys from the documentation and try to test it on a live server.

I wanted to ask right away, if you are aware, do I understand correctly that in aсl.legacy there is now an older format for communicating with the API for managing tokens and rules? What I suggested in the PR will be relevant, in terms of the description in the Consul documentation?

To be honest, I'm a little confused about the documentation and changes between versions.

@silas
Copy link
Owner

silas commented Mar 19, 2023

Yes, there is a legacy ACL policies and tokens API, which you can see here: https://developer.hashicorp.com/consul/api-docs/v1.14.x/acl/legacy.

It looks like it's not documented in v1.15 anymore and it looks like they removed it in 1.11.0. I figure we should keep the legacy methods around until the versions of consul that include it are no longer supported, which I assume could be a while.

In regards to the API we can just refer to the endpoints you implemented as the standard versions and we don't need to add any type of modifier when documenting them (e.g. we don't need to say new Token API or anything like that).

Also, when documenting/implementing the API endpoints I liberally copy/paste from https://developer.hashicorp.com/consul/api-docs (the NOTICE includes appropriate attribution/license for using that text).

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