You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user,
I want to be sure the token (API key) I set and use for uploading reports to portal is in correct format,
so I will get quick and understandable feedback that my token is missing or missconfigured.
Acceptance criteria
validate the prefix cp_ should always be present
validate the hash lenght as it is always 64 hexadecimal characters
strip possible the unnecessary surrounding quotes
the logic for validation/stripping should live in the @code-pushup/portal-client package and be consumed by the CLI
Implementation details
A regex of /^cp_[0-9a-f]{64}$/ could be used.
Additional pre-check if token is wrapped in " or ' quotes as this could be done if user copy pastes from code or assumes it needs to be in explicit string format. We could recover easily by stripping the quotes.
The text was updated successfully, but these errors were encountered:
User story
Acceptance criteria
cp_
should always be present@code-pushup/portal-client
package and be consumed by the CLIImplementation details
A regex of
/^cp_[0-9a-f]{64}$/
could be used.Additional pre-check if token is wrapped in
"
or'
quotes as this could be done if user copy pastes from code or assumes it needs to be in explicit string format. We could recover easily by stripping the quotes.The text was updated successfully, but these errors were encountered: