-
Notifications
You must be signed in to change notification settings - Fork 21
Create gRPC service to be used by the CLI #855
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
base: main
Are you sure you want to change the base?
Conversation
internal/proto/authd/authd.proto
Outdated
@@ -195,3 +195,31 @@ message ShadowEntry { | |||
message ShadowEntries { | |||
repeated ShadowEntry entries = 1; | |||
} | |||
|
|||
service CLI { |
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 wouldn't call it CLI but I rather something like Manager or something similar, as this something that we could ideally expose later in other tools (such as gcc), and we can include here every operation that is about the management of authd (or its users) itself, despite the UI that is used for that.
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.
Ok, what about this structure then:
service UsersService {
rpc ListUsers(Empty) returns (Users);
rpc DisableUser(DisableUserRequest) returns (Empty);
rpc EnableUser(EnableUserRequest) returns (Empty);
}
message User {
string name = 1;
uint32 uid = 2;
uint32 gid = 3;
string gecos = 4;
string homedir = 5;
string shell = 6;
}
message Users {
repeated User users = 1;
}
service GroupsService {
rpc ListGroups(Empty) returns (Groups);
}
message Group {
string name = 1;
uint32 gid = 2;
repeated string members = 3;
}
message Groups {
repeated Group groups = 1;
}
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, that's better, we can still keep it more generic, but I feel this is enough, and in case we can add another one if needed
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 implemented something similar to that
371a5e8
to
5f50f59
Compare
5f50f59
to
06df31f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #855 +/- ##
==========================================
- Coverage 85.37% 85.37% -0.01%
==========================================
Files 80 80
Lines 5532 5518 -14
Branches 109 109
==========================================
- Hits 4723 4711 -12
+ Misses 754 752 -2
Partials 55 55 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Some suggestions that I think will make the changes better (I didn't add the same comment on every single crate of the module, but some apply to all three)
a941098
to
9ddf755
Compare
9ddf755
to
0fdb6bc
Compare
Converting to draft until I fixed the tests |
pam/integration-tests/ssh_test.go
Outdated
userPasswd := requireNSSUser(t, nssClient, user) | ||
group := requireNSSGroup(t, nssClient, userPasswd.Gid) | ||
if userClient != nil { | ||
userPasswd := requireNSSUser(t, userClient, user) |
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.
Rename this function too please
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.
done
pam/integration-tests/ssh_test.go
Outdated
if nssClient != nil { | ||
requireNoNSSUser(t, nssClient, user) | ||
if userClient != nil { | ||
requireNoNSSUser(t, userClient, user) |
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.
Rename this function too please
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.
done
pam/integration-tests/ssh_test.go
Outdated
group := requireNSSGroup(t, nssClient, userPasswd.Gid) | ||
if userClient != nil { | ||
userPasswd := requireNSSUser(t, userClient, user) | ||
group := requireNSSGroup(t, userClient, userPasswd.Gid) |
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.
And this
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.
done
e2cf75f
to
aaf77bf
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 to me. Nice work! Once @3v1n0 is also happy, feel free to merge.
8c7cff5
to
61b1d8d
Compare
The NSS service duplicated functionality from the user service.
61b1d8d
to
69dc5ec
Compare
Thanks @adombeck for the awesome work. |
The current state of #782 adds the gRPC methods used by the CLI to the NSS service. They don't belong there, so this PR adds a new gRPC service which provides methods intended for use by the CLI.
UDENG-6492