How do I use the API to get/update the ACLs? Call...
# server
c
How do I use the API to get/update the ACLs? Calls to
/api/networks/skynet/acls
give
{"Code":401,"Message":"unauthorized"}
And trying to authenticate using
/api/nodes/adm/stellaprod/authenticate
gets
{"Code":400,"Message":"crypto/bcrypt: hashedPassword is not the hash of the given password"}
The docs also miss the "id" being required for the nodes authentication call
The swagger doc link is very easy to miss
And how do I help make the swagger docs more than just the endpoints?
j
@most-rain-82770 ^
for the auth token, the easiest way is to use your master key (in docker compose)
or
log in via UI and inspect using dev tools, and grab the auth token from there
m
For collaboration it's the Netmaker repo. controllers/docs.go has the overall definition and types. The individual files under controllers (eg. network.go the ACL endpoint you mention) have markup (in comments) above each handler function.
a
Hi, jumping in on this thread as i can use the API with the MASTER_KEY as set in my docker env, but will like to use the 2nd. procedure of JWT for an admin user i created only to administer a specific network but not as super-admin. hence i do not want to have/use the master key. - where to find and use the "*JWT received for a node*" as said in the docs API section Authentication ? - the swagger API endpoint details a POST to
/api/nodes/adm/tvnc/authenticate
requiring the object
Copy code
{
  "id": "string",
  "macaddress": "string",
  "password": "string"
}
- if i try to copy the long Auth Token simulating the browser logon where do we need to put that in ? at the moment the API call fails building on the swagger docs with the error
Copy code
{
  "Code": 400,
  "Message": "crypto/bcrypt: hashedPassword is not the hash of the given password"
}
Finally managed to "generate" the JWT for a user associated only to a network (not a super-admin user) thru the ..
POST /api/users/adm/authenticate "Node authenticates using its password and retrieves a JWT for authorization"
On the swaggerhub apis-docs the description of this API call should be *"**User *authenticates using its password and retrieves a JWT for authorization" - other way round can someone explain how to remove List/Revoke used AuthTokens ? currently one has to delete the user to revoke all pre generated JWT's associated with that user. - but those invalidated tokens could be reused if the same username is recreated even with a different password, this could possibly be a security issue. I would suggest a way to destroy the JWT. Lastly, how does one use the API call to ..
POST /api/nodes/adm/{network}/authenticate "Authenticate to make further API calls related to a network."