Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetaGer Keymanager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer Keymanager
Commits
811c9f5f
Commit
811c9f5f
authored
9 months ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
handle undefined keys
parent
050d5f12
No related branches found
No related tags found
No related merge requests found
Pipeline
#9936
passed
9 months ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pass/app/Key.js
+6
-2
6 additions, 2 deletions
pass/app/Key.js
with
6 additions
and
2 deletions
pass/app/Key.js
+
6
−
2
View file @
811c9f5f
...
@@ -304,6 +304,10 @@ class Key {
...
@@ -304,6 +304,10 @@ class Key {
static
async
GET_KEY
(
key
,
writable
=
false
)
{
static
async
GET_KEY
(
key
,
writable
=
false
)
{
// Check if supplied key is UUID v4
// Check if supplied key is UUID v4
if
(
!
Key
.
IS_VALID_UUID
(
key
))
{
if
(
!
Key
.
IS_VALID_UUID
(
key
))
{
if
(
typeof
key
!=
"
string
"
)
{
key
=
""
;
}
const
{
createHash
}
=
await
import
(
"
node:crypto
"
);
const
{
createHash
}
=
await
import
(
"
node:crypto
"
);
let
hash
=
createHash
(
"
md5
"
);
let
hash
=
createHash
(
"
md5
"
);
hash
.
update
(
key
);
hash
.
update
(
key
);
...
@@ -391,8 +395,8 @@ class Key {
...
@@ -391,8 +395,8 @@ class Key {
});
});
}
}
static
IS_VALID_UUID
(
input_key
){
static
IS_VALID_UUID
(
input_key
)
{
if
(
!
input_key
||
typeof
input_key
!=
"
string
"
)
return
false
;
if
(
!
input_key
||
typeof
input_key
!=
"
string
"
)
return
false
;
return
input_key
.
match
(
return
input_key
.
match
(
/^
[
0-9A-F
]{8}
-
[
0-9A-F
]{4}
-
[
4
][
0-9A-F
]{3}
-
[
89AB
][
0-9A-F
]{3}
-
[
0-9A-F
]{12}
$/i
/^
[
0-9A-F
]{8}
-
[
0-9A-F
]{4}
-
[
4
][
0-9A-F
]{3}
-
[
89AB
][
0-9A-F
]{3}
-
[
0-9A-F
]{12}
$/i
);
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment