Skip to content

Conversation

@mtreinish
Copy link
Contributor

Currently a secret can only be set when the Webhook object is
initialized. However, this limits your options for how you can load in
the secret. For example, if a user's flask app parses a config file
using the flask before_first_request decorator and they wanted to store
the secret in that config file, then the only way to edit the value of
the secret is by directly setting a private attribute of the object
after initialization. This commit attemps to address this issue and
support the use case where the config is after the Webhook object is
initialized. It does this by adding a new public method, set_secret(),
which can be used to set the set secret value for the webhook object
just as if it was passed in as a kwarg to init().

Signed-off-by: Matthew Treinish mtreinish@kortar.org

Currently a secret can only be set when the Webhook object is
initialized. However, this limits your options for how you can load in
the secret. For example, if a user's flask app parses a config file
using the flask before_first_request decorator and they wanted to store
the secret in that config file, then the only way to edit the value of
the secret is by directly setting a private attribute of the object
after initialization. This commit attemps to address this issue and
support the use case where the config is after the Webhook object is
initialized. It does this by adding a new public method, set_secret(),
which can be used to set the set secret value for the webhook object
just as if it was passed in as a kwarg to __init__().

Signed-off-by: Matthew Treinish <mtreinish@kortar.org>
@alexchamberlain
Copy link
Contributor

Thank you for taking the time to contribute this @mtreinish . I have chosen to merge the changes under #25 instead.

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.

2 participants