harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
31.89k stars 2.78k forks source link

Increase character limit for storing secrets #3493

Closed rambhosale closed 2 months ago

rambhosale commented 3 months ago

Currently, the character limit for storing secrets in Gitness repositories is 1024 characters. This limit is proving to be quite restrictive for projects that require secure storage of sensitive information such as API keys, passwords, and tokens.

Currently, I am splitting one long secret into multiple secrets and then merging them into one inside the pipeline, this is not the optimal solution and there should be a straightforward way of using long secrets.

So can we increase this limit using some configs? Or is there an existing way to add a long string?

If not I would like to submit a PR for this change.

bradrydzewski commented 3 months ago

the type should be a blob for sqlite and a bytea for postgres to allow for much larger file stores [1] to align with drone. If there is a limit of 1024 bytes in place, I agree that it definitely needs to be improved. Would you consider sending a pull request and then I can ask the team to review?

Note that I don't think this is something we should need to make configurable. We should either remove the limit entirely or place a limit sufficiently large enough that it will handle all modern use cases (e.g. 5mb)

[1] https://github.com/harness/gitness/blob/drone/store/shared/migrate/postgres/files/009_create_table_secrets.sql#L7

rambhosale commented 3 months ago

@bradrydzewski I created a PR for accepting around ~5MB(5000000 chars), please have a look at it

rambhosale commented 2 months ago

Closing as https://github.com/harness/gitness/pull/3494 is merged