Open NightHammer1000 opened 23 hours ago
In addition to that, /api/setup-keys/{keyId} - Retrieve a Setup Key does also not work at all in our setup. No matter what ID i try to get we always get the Response
{"message":"setup key: cqaj8pd6m1gc7385f0a0 not found","code":404}
Its always the same. No matter what ID we throw at the API. I could input random Numbers and Letters and it will also return this exact response
Hi @NightHammer1000, the behaviour of the list setup-keys api is correct. From now on all setup-keys will be hashed in the database and only the 5 digit secret will be stored. As the keys are now hashed there is no way of retrieving existing keys after they have been created. This is done to improve security so even with access to the database no one will be able to get a hold of the key except the user creating it.
Regarding the /api/setup-keys/{keyId} always returning not found, for me it is the same. I will have a look into whats going wrong here. Thanks for reporting this!
Okay. This is kinda bad for us. Thanks for the Info anyway!
As we Previously used the Setup Keys to place the Devices in their respective Groups Automatically to make use of the Policys.
I guess we can work around it in our Setup Script by first pulling a List of Groups from which our Install Engineer can choose the correct one from and then creating a one time use Key for that Group instead of pulling the Multi-Use Key from API.
Will Create Setup Key return the full key? Or also just the Hashed one?
Also. This change should definetly be reflected at https://docs.netbird.io/api/resources/setup-keys before more people waste their expensive time ^^
Yes when creating a new setup key it will still return the full key for you to copy. The hashed one is only used in the database itself and for other GET calls we will return only the first 5 digits of the key for you to compare with your copy.
Sorry that you lost time on this, we missed the API docs update. The PR I created also includes an update for the openAPI specs so that the docs generation will be updated once the PR is merged.
Describe the problem
We use the Netbird API in our Setup Routine for a custom Ubuntu Install to get a list of all the Setup Keys to choose which one to use for the Installation of the Netbird Client.
In the Past we got a list of the Full key like it is discribed here https://docs.netbird.io/api/resources/setup-keys
Now after Updating to 0.32.0 we do not get the whole API Key anymore. Just the Five first Digits. The Rest is masked out by Stars.
Are you using NetBird Cloud?
No This is a self hosted installation
Additional context
The Answer we get from the API Call:
Is this related to https://github.com/netbirdio/netbird/issues/2763 and https://github.com/netbirdio/netbird/pull/2775 ? If yes, is there now an diffrent way to get the Setup Keys once they are already created?