Skip to content

Commit 9185625

Browse files
committed
fixed checking secret type
1 parent 7f87fc7 commit 9185625

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/kraken/server/schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ def check_and_correct_stage_schema(branch, stage_name, schema_code, context=None
170170
secret = Secret.query.filter_by(project=branch.project, name=value).one_or_none()
171171
if secret is None:
172172
raise SchemaError("Secret '%s' does not exist" % value)
173-
if secret.kind != consts.SECRET_KIND_SSH_KEY:
173+
if field == 'access-token' and secret.kind != consts.SECRET_KIND_SIMPLE:
174+
raise SchemaError("Type of '%s' secret should be Simple" % value)
175+
if field == 'ssh-key' and secret.kind != consts.SECRET_KIND_SSH_KEY:
174176
raise SchemaError("Type of '%s' secret should be SSH Username & Key" % value)
175177

176178
# TODO: check if git url is valid according to giturlparse

0 commit comments

Comments
 (0)