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

feat: --allow-commands restricts available atlantis commands #2877

Merged
merged 7 commits into from
Dec 28, 2022

Conversation

krrrr38
Copy link
Contributor

@krrrr38 krrrr38 commented Dec 24, 2022

what

  • add --allow-commands whitelist server configuration
    • This flag checks comment_parser and version,plan,apply,unlock,approve_policies is default.
    • --disable-apply become deprecated. if set true, server remove apply command from --allow-commands.
    • for backward compatibility, if --enable-policy-check is true, approve_policies is allowd in --allow-commands.

why

  • Users may not want to introduce a particular command such as import.
  • Future commands may be added but required by --allow-commands.

references

@krrrr38 krrrr38 marked this pull request as ready for review December 24, 2022 21:34
@krrrr38 krrrr38 requested a review from a team as a code owner December 24, 2022 21:34
cmd/server.go Outdated Show resolved Hide resolved
cmd/server.go Outdated Show resolved Hide resolved
cmd/server_test.go Outdated Show resolved Hide resolved
runatlantis.io/docs/using-atlantis.md Outdated Show resolved Hide resolved
runatlantis.io/docs/using-atlantis.md Outdated Show resolved Hide resolved
@jamengual
Copy link
Contributor

sorry @krrrr38 we are commenting before you ask for review!!!
Thanks for another great PR

@jamengual jamengual added the feature New functionality/enhancement label Dec 24, 2022
@nitrocode
Copy link
Member

Yes, seconded from me! You are a strong contributor. Keep up the good work. I left a couple comments and opinions

@krrrr38
Copy link
Contributor Author

krrrr38 commented Dec 24, 2022

(btw not need review so much on this seasons 👌 )

@nitrocode nitrocode changed the title feat: --allow-commands configuration restricts available atlantis commands feat: --allow-commands restricts available atlantis commands Dec 25, 2022
@nitrocode
Copy link
Member

nitrocode commented Dec 27, 2022

It's looking good to me! Thank you @krrrr38 !

@marcusramberg @Fabianoshz @runatlantis/maintainers for additional views and if we want to put this in 0.22.0 or the following release?

@nitrocode nitrocode added this to the 0.22.1 milestone Dec 27, 2022
@marcusramberg
Copy link
Contributor

Looks really solid to me. Well tested, and didn't spot any obvious problems.

@nitrocode nitrocode merged commit f09a9d4 into runatlantis:main Dec 28, 2022
@nitrocode nitrocode modified the milestones: 0.22.1, 0.22.0 Dec 28, 2022
@nitrocode
Copy link
Member

Thank you @krrrr38 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flag to allow specific atlantis commands (e.g. plan,apply,import)
5 participants