Skip to content

feat: allow to use environment variables for limit-count plugin settings#10607

Merged
juststillthinking merged 11 commits into
apache:masterfrom
ikatlinsky:feat/add-env-vars-support-for-limit-count-plugin
Dec 18, 2023
Merged

feat: allow to use environment variables for limit-count plugin settings#10607
juststillthinking merged 11 commits into
apache:masterfrom
ikatlinsky:feat/add-env-vars-support-for-limit-count-plugin

Conversation

@ikatlinsky

@ikatlinsky ikatlinsky commented Dec 6, 2023

Copy link
Copy Markdown
Contributor

Description

As per #10597.

Fixes #10597

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@ikatlinsky ikatlinsky changed the title Allow to use environment variables for limit-count plugin settings feat: allow to use environment variables for limit-count plugin settings Dec 6, 2023
@ikatlinsky
ikatlinsky marked this pull request as ready for review December 6, 2023 10:59
@moonming

moonming commented Dec 6, 2023

Copy link
Copy Markdown
Member

@ikatlinsky thank you for your contribution 👍

Comment thread apisix/plugins/limit-count.lua Outdated
Comment thread apisix/plugins/limit-count/init.lua Outdated
type = "boolean", default = false,
},
},
encrypt_fields = {"redis_username", "redis_password"},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does the redis_username need to be encrypted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

actually, not really, will fix that

Comment thread t/plugin/limit-count-redis-cluster3.t
Comment thread t/plugin/limit-count5.t
"count": 2,
"time_window": 60,
"rejected_code": 503,
"key": "$ENV://LIMIT_COUNT_KEY"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same reasoning as above

@juststillthinking juststillthinking added the wait for update wait for the author's response in this issue/PR label Dec 7, 2023
Comment thread apisix/plugins/limit-count/init.lua Outdated
type = "boolean", default = false,
},
},
encrypt_fields = {"redis_password"},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

your are correct, that i am doing 2 different things in a single PR, let me ever this change

@ikatlinsky

Copy link
Copy Markdown
Contributor Author

@monkeyDluffy6017 looking at failing tests (https://github.com/apache/apisix/actions/runs/7124716224/job/19435705333?pr=10607) and it seems like tests for multiple plugins are failed, like request id, openwisk and etc. It that something that is expected? Not sure if my changes can break other plugins.

Thanks

@juststillthinking

Copy link
Copy Markdown
Contributor

@ikatlinsky It has nothing to do with you changes

@juststillthinking juststillthinking added approved and removed wait for update wait for the author's response in this issue/PR user responded labels Dec 11, 2023

@juststillthinking juststillthinking left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please resolve the conflicts

@ikatlinsky

Copy link
Copy Markdown
Contributor Author

please resolve the conflicts

done

@juststillthinking
juststillthinking merged commit bf8940d into apache:master Dec 18, 2023
@ikatlinsky
ikatlinsky deleted the feat/add-env-vars-support-for-limit-count-plugin branch December 18, 2023 06:50
shreemaan-abhishek pushed a commit to shreemaan-abhishek/apisix that referenced this pull request Jan 2, 2026
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.

feat: As a user i want to configure sensitive limit-count plugin properties using environment variables

5 participants