-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add support for APNS and FCM endpoints for Direct mode Guardian #184
Add support for APNS and FCM endpoints for Direct mode Guardian #184
Conversation
dec01e9
to
45bfaaa
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #184 +/- ##
==========================================
+ Coverage 94.88% 94.91% +0.02%
==========================================
Files 38 38
Lines 6810 6846 +36
==========================================
+ Hits 6462 6498 +36
Misses 278 278
Partials 70 70
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
2961f5d
to
adb49ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the lint issue flagged in the tests this looks good. Thanks @lochiiconnectivity!
management/guardian_test.go
Outdated
// as it is incompatible | ||
|
||
// Read the p12 from file | ||
expectedP12, err := ioutil.ReadFile("../test/data/apns.p12") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why it isn't been shown inline, but the linter is flagging the usage of ioutil.ReadFile
here, asking to use os.ReadFile
instead.
SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted to use io/ioutil, in keeping with the style of the current project and not introducing any new dependencies, as you can see, it's used by https://github.com/auth0/go-auth0/blob/main/management/gen-methods.go#L22 , and specifically called at https://github.com/auth0/go-auth0/blob/main/management/gen-methods.go#L198 , happy to change out to os.ReadFile if you wish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it will need to change if you can please in order to pass the linting. The gen-methods.go is ignored by the linter it seems, but I'll look to get that updated to keep it consistent.
adb49ee
to
836b4da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once again thanks for this change @lochiiconnectivity!
We wanted to regenerate the p12 file to ensure it was clean of any PII so I went ahead and fixed the ioutil warning and pushed that.
🔧 Changes
Add support for customising APNS and FCM on the Guardian (push) direct provider, supporting the following endpoints:
This is to support configuration of the direct provider.
📚 References
auth0/terraform-provider-auth0#535 (comment)
🔬 Testing
for APNS, Setting Sandbox mode, BundleID and P12 is supported. P12 must be provided as a Base64 Encoded String. When retrieving APNS configuration, the P12 will not be returned, and will instead be replaced by an "enabled" flag. It is not possible to update this flag.
for FCM, Setting only ServerKey is supported, it is not possible to query FCM state.
📝 Checklist