Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: Validate workflowName is exactly 10 bytes #824

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/workflows/models_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ParseWorkflowSpecYaml(data string) (sdk.WorkflowSpec, error) {
type WorkflowSpecYaml struct {
// NOTE: Name and Owner are constrained the onchain representation in [github.com/smartcontractkit/chainlink-common/blob/main/pkg/capabilities/consensus/ocr3/types/Metadata]

Name string `json:"name,omitempty" jsonschema:"pattern=^[0-9A-Za-z_\\-]+$,maxLength=10"` // plain text string exactly 10 characters long, or empty name allowed for anonymous workflows
Name string `json:"name,omitempty" jsonschema:"pattern=^[0-9A-Za-z_\\-]+$,minLength=10,maxLength=10"` // plain text string exactly 10 characters long, or empty name allowed for anonymous workflows
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about "or empty name allowed for anonymous workflows"?

//Name nameYaml `json:"name"`
Owner string `json:"owner,omitempty" jsonschema:"pattern=^0x[0-9a-fA-F]{40}$"` // 20 bytes represented as hex string with 0x prefix, or empty owner allowed for anonymous workflows
// Triggers define a starting condition for the workflow, based on specific events or conditions.
Expand Down
Loading