Skip to content

Commit

Permalink
Check SimpleFIN access key format (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
psybers authored Nov 3, 2024
1 parent 2cd3c9f commit 879869c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app-simplefin/app-simplefin.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ function parseAccessKey(accessKey) {
let username = null;
let password = null;
let baseUrl = null;
if (!accessKey || !accessKey.match(/^.*\/\/.*:.*@.*$/)) {
console.log(`Invalid SimpleFIN access key: ${accessKey}`);
throw new Error(`Invalid access key`);
}
[scheme, rest] = accessKey.split('//');
[auth, rest] = rest.split('@');
[username, password] = auth.split(':');
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/485.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [psybers]
---

Check if SimpleFIN accessKey is in the correct format.

0 comments on commit 879869c

Please sign in to comment.