-
Notifications
You must be signed in to change notification settings - Fork 55
CLI and partial Webvault compatibility #7
Conversation
@Pschittt I found the problem with the The Angular JWT plugin web uses must whitelist domains where it will send the JWT. Unfortunately it's hardcoded in this file. When I edited the file locally and added the domain of my API Gateway, I received the Bearer token. Do you want to continue working on this ticket and finish it up? I see some more endpoints are needed such as /profile etc. One thing to watch out, check coding style with |
@vvondra I've pulled your latest commit, to continue with your version. About the JWT not sent, it's curious, because I have a web vault running perfectly with the API-Ruby backend. I'll keep looking. I confirm, there is a log of endpoint to add. But the "hardwork" has been done here : About ESLint, I don't understand. I don't seen any file |
@Pschittt run I think the Bitwarden author merged some recent changes, maybe you have some older version of web vault for the Ruby port? Here is my diff of the web vault locally where it works for me: diff --git a/package.json b/package.json
index 3745ba2..43bb1df 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "bitwarden",
"version": "1.22.0",
- "env": "Production",
+ "env": "Development",
"devDependencies": {
"connect": "3.6.5",
"lodash": "4.17.4",
diff --git a/settings.json b/settings.json
index 9029e0c..48501b4 100644
--- a/settings.json
+++ b/settings.json
@@ -1,7 +1,7 @@
{
"appSettings": {
- "apiUri": "http://localhost:4000",
- "identityUri": "http://localhost:33656",
+ "apiUri": "https://abcded.execute-api.us-east-1.amazonaws.com/test/api",
+ "identityUri": "https://abcded.execute-api.us-east-1.amazonaws.com/test/identity",
"iconsUri": "https://icons.bitwarden.com",
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2"
diff --git a/src/app/config.js b/src/app/config.js
index 5e50d69..e82df21 100644
--- a/src/app/config.js
+++ b/src/app/config.js
@@ -16,7 +16,7 @@ angular
// @if false
jwtOptionsProvider.config({
- whiteListedDomains: ['localhost', 'api.bitwarden.com', 'vault.bitwarden.com']
+ whiteListedDomains: ['localhost', 'api.bitwarden.com', 'vault.bitwarden.com', 'abcded.execute-api.us-east-1.amazonaws.com']
});
// @endif |
I have the pretty same config as you. Only on the config.js file (for the web vault), I've used a variable for the WhitelistDomain. I have commented the line whiteListedDomains ... and added : And I've defined the "whitelistDomains" in the settings.js file with the api url. With that, I can get the bearer send by the web vault. |
@vvondra You're right. It has been hardcoded a few days ago. |
I think at this point Web is still not working (and it's not so easy to set up a custom deployment with custom URL anyway), but the changes here make it work with the CLI. |
- unified CORS settings for all functions - ESLint fixes - import fixes causing runtime errors
PR for #1
@Pschittt, check out my latest commit. There were some runtime errors with bad imports and I also made all the routes respond with the same OPTIONS CORS headers.
Now on login through webvault I get a successful login and when it hit the /keys endpoint, it doesn't pass any Authorization information. Checking why