Skip to content

[Cloud Security] Add support for required conditional groups of variables#855

Merged
jsoriano merged 10 commits intomainfrom
required-fields
Jan 22, 2025
Merged

[Cloud Security] Add support for required conditional groups of variables#855
jsoriano merged 10 commits intomainfrom
required-fields

Conversation

@seanrathier
Copy link
Contributor

@seanrathier seanrathier commented Jan 14, 2025

What does this PR do?

Add support for conditionally required groups of variables.

Why is it important?

In some cases, policy templates like CloudFlare and CSPM will have mutually exclusive input variables that are required.

For example, access_key and secret_key or the session_token is required

required_vars:
    - [access_key,secret_key]
    - [session_token]

Checklist

Related issues

@seanrathier seanrathier marked this pull request as ready for review January 14, 2025 22:08
@seanrathier seanrathier requested a review from a team as a code owner January 14, 2025 22:08
@seanrathier seanrathier requested a review from jsoriano January 16, 2025 16:27
jsoriano
jsoriano previously approved these changes Jan 16, 2025
description: Can input be defined multiple times
type: boolean
default: false
required_vars:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be added also into input packages ? @jsoriano @seanrathier

Copy link
Member

Choose a reason for hiding this comment

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

We could add there later if needed. @seanrathier do you need this for your current use case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I only need it in stream/inputs

@elasticmachine
Copy link

💚 Build Succeeded

History

@jsoriano jsoriano merged commit a581c17 into main Jan 22, 2025
3 checks passed
@jsoriano jsoriano deleted the required-fields branch January 22, 2025 19:26
jsoriano added a commit that referenced this pull request Jan 23, 2025
Add semantic validation and some additional tests for required variable
groups added in #855.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Change Proposal] Add support for required conditional groups of variables

4 participants