-
Notifications
You must be signed in to change notification settings - Fork 9
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 endpoint for retrieving a user's info by ID #268
Conversation
@@ -162,6 +162,40 @@ func (s userInfoService) LookupUserInfoByID(ctx context.Context, id gidx.Prefixe | |||
return ui, err | |||
} | |||
|
|||
// LookupUserOwnerID finds the Owner ID of the Issuer for the given User ID. | |||
func (s userInfoService) LookupUserOwnerID(ctx context.Context, id gidx.PrefixedID) (gidx.PrefixedID, error) { |
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.
Can we get a test of 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.
Missed a couple of small things here (which we probably want tests for).
internal/api/httpsrv/handle_user.go
Outdated
if err != nil { | ||
return nil, echo.NewHTTPError(http.StatusNotFound, err) | ||
} |
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 could fail for reasons that aren't a not found error, right?
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.
Indeed, I meant to replace these with switch statements. Thanks.
internal/api/httpsrv/handle_user.go
Outdated
info, err := h.engine.LookupUserInfoByID(ctx, req.UserID) | ||
if err != nil { | ||
return nil, echo.NewHTTPError(http.StatusBadRequest, err) | ||
} |
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.
Same re: errors here. This actually looks like a server error.
318deb3
to
4a2020d
Compare
4d66d35
to
9420dc1
Compare
This adds an http endpoint for retrieving a users information by the user's ID. Permission is checked by checking the user issuer's owner ID for iam_user_get action. Signed-off-by: Mike Mason <[email protected]>
9420dc1
to
b87c211
Compare
This adds an http endpoint
/api/v1/users/{userID}
for retrieving a users information by the user's ID.Permission is checked by checking the user issuer's owner ID for iam_user_get action.