-
Notifications
You must be signed in to change notification settings - Fork 16
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
pam: Add GDM JSON protocol definition #121
Conversation
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.
Hey, @3v1n0! Some minor nitpicks here and there.
But there's a major but: It's very hard to review and approve a protocol definition without seeing it being used and hooked up, so these changes should come together with the actual GDM module implementation rather than in a standalone PR.
36ff68c
to
c498594
Compare
I'll move this to draft, as we discussed during the HO. |
c498594
to
6238320
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #121 +/- ##
==========================================
+ Coverage 88.62% 88.82% +0.20%
==========================================
Files 34 35 +1
Lines 2532 2640 +108
==========================================
+ Hits 2244 2345 +101
- Misses 221 227 +6
- Partials 67 68 +1 ☔ View full report in Codecov by Sentry. |
53cf468
to
4e9ba77
Compare
4e9ba77
to
8638e82
Compare
4ee594a
to
0b84f6b
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.
Great work! This is definitely cleaner than the previous approach - I had some minor comments
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.
Couple more things I spotted
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.
Nice work, I'll let you squash before merging :)
We use JSON to communicate with GDM since its UI, GNOME Shell is in JavaScript and so can handle those messages natively pretty well. Here we define the primitives of this protocol and their conversion back and forth from go structures and types, ensuring the expectations are met. The protocol code generation is mostly done via protobuf so that we can avoid manual definition of many structures, but is meant for being used from the JSON side too thus using some naming conventions to please both cases.
We may want to enable some checks only during checks or debug builds to be used in integration tests, so let's abstract things a bit more by exposing some features at runtime only. This allows to generate normal builds without debug checks but at the same time, to avoid having to define special build tags when testing, leaving the room for using special tags for building different binaries for integration tests or local debugging.
When using this tag on `go build` or `go generate` we: - Add more debug symbols to built libraries - Enable pedantic checks on data structures used by GDM proto To achieve this, add a further generate_debug.go file that is only used when the `pam_debug` tag is used, this now also builds the gdm code with the `pam_gdm_debug` build tag that implies enabling by default some checks that are not enabled by default. Update CI job to ensure this works.
b328b7b
to
9f4f56d
Compare
Thanks, all squashed now :) |
We use JSON to communicate with GDM since its UI, GNOME Shell is in JavaScript and so can handle those messages natively pretty well.
Here we define the primitives of this protocol and their conversion back and forth from go structures and types, ensuring the expectations are met.
The protocol code generation is mostly done via protobuf so that we can avoid manual definition of many structures, but is meant for being used from the JSON side too thus using some naming conventions to please both cases.
UDENG-1466