Skip to content

Conversation

@drobnikj
Copy link
Member

@drobnikj drobnikj commented Sep 26, 2022

Add support for secure input values by adding isSecret flag into the sting property

The flag is optional, so the change is not breaking.

EDIT:

I improved validation, if isSecret is true fields:
['minLength', 'maxLength','default', 'prefill', 'pattern']
are not in string type definition and editor is only enum for
['textfield', 'textarea', 'hidden']

@github-actions github-actions bot added this to the 47th sprint - Platform team milestone Sep 26, 2022
@github-actions github-actions bot added the t-core-services Issues with this label are in the ownership of the core services team. label Sep 26, 2022
@drobnikj drobnikj marked this pull request as ready for review September 27, 2022 08:34
Copy link
Member

@mtrunkat mtrunkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it going to work with other options such as:

  • editor? We could display the correct editor later on in the modal? This is useful, for example, for some secret JSON values.
  • we should probably disable max/min length as it could collide with encrypted data or no?

@drobnikj
Copy link
Member Author

drobnikj commented Sep 29, 2022

@mtrunkat I cannot find any way how to do conditional fields in json schema. As you said, it would be good, but not sure how to do it in schema.

As Franta mention we can use draf-07 I was thinking only for draft-04 🤦

@fnesveda
Copy link
Member

@drobnikj JSON schema now supports if-then-else (since draft-07), maybe that would work?
https://json-schema.org/understanding-json-schema/reference/conditionals.html#if-then-else

@fnesveda
Copy link
Member

fnesveda commented Oct 3, 2022

Also, if the conditional fields in the schema are possible, maybe we should disable prefill and default for secret fields too, it would make the frontend code a lot easier, and I don't think it really hurts any usecase.

@drobnikj
Copy link
Member Author

drobnikj commented Oct 4, 2022

I have quite hard times finding way how to do it. It is a little bit breakneck, but it should work.

@drobnikj drobnikj requested review from fnesveda and mtrunkat October 4, 2022 13:34
@drobnikj
Copy link
Member Author

drobnikj commented Oct 4, 2022

I updated the schema, please check again @fnesveda @mtrunkat

Copy link
Member

@fnesveda fnesveda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uff, nice job!

I thought it would be easier, but the additionalProperties rule is making it complicated.

@drobnikj drobnikj requested a review from jirimoravcik October 6, 2022 11:49
@drobnikj drobnikj merged commit 29be923 into master Oct 7, 2022
@drobnikj drobnikj deleted the feat/input_schema_is_secret branch October 7, 2022 12:38
@fnesveda fnesveda added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-core-services Issues with this label are in the ownership of the core services team. validated Issues that are resolved and their solutions fulfill the acceptance criteria.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants