-
Notifications
You must be signed in to change notification settings - Fork 21
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
Device Access Validator #117
Conversation
this fixes #116 |
fixes #106 |
deaec22
to
21331a1
Compare
87a2d0c
to
0b5ad52
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.
Looks good so far! We've talked about some stuff and I left some comments in the code.
deviceAccess.go
Outdated
// values presented by API users against those of the device | ||
type deviceAccessCheck struct { | ||
Name string | ||
//UserCredentialPath is the Sep-delimited path to the credential value |
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.
Please add a space between the //
and the beginning of the comment for easier readability (not marking all of them in this file).
Co-Authored-By: kristinaspring <[email protected]>
…aria into feature/deviceAccessChecks
Codecov Report
@@ Coverage Diff @@
## master #117 +/- ##
=======================================
Coverage 58.44% 58.44%
=======================================
Files 14 14
Lines 977 977
=======================================
Hits 571 571
Misses 397 397
Partials 9 9 Continue to review full report at Codecov.
|
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.
Looks great! Just one tiny thing.
main.go
Outdated
// We are getting bombarded with SIGURGS due to Go1.14's new way to async preempt goroutines https://github.com/golang/go/issues/37942 | ||
// Don't log as info as it will fill log with unnecessary entries |
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.
We should make an issue in other service repos to fix this there as well.
primaryHandler.go
Outdated
parsedChecks = append(parsedChecks, parsedCheck) | ||
} | ||
|
||
if config.Type == "enforce" || config.Type == "monitor" { |
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.
This code could be flatter by checking at the beginning of this function to verify that the type is "enforce" or "monitor", and returning an error if it's not either. Then, the positive case will be the one returned at the end of this function. 🙂
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.
Good idea, thanks!
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.
Looks good!
Changes introduced in this PR:
TODO:
contains
(a must for partnerIDs),intersect
andequals
might be enough for this first PR. Let me know if that's not the case.Update metrics accordingly
Unit test updates