-
Notifications
You must be signed in to change notification settings - Fork 896
feat: Add organizations endpoint for users #50
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
Conversation
This moves the /user endpoint to /users/me instead. This will reduce code duplication. This adds /users/<name>/organizations to list organizations a user has access to. It doesn't contain the permissions a user has over the organizations, but that will come in a future contribution.
Codecov Report
@@ Coverage Diff @@
## main #50 +/- ##
==========================================
+ Coverage 71.25% 71.48% +0.23%
==========================================
Files 59 60 +1
Lines 2327 2395 +68
Branches 30 30
==========================================
+ Hits 1658 1712 +54
- Misses 523 532 +9
- Partials 146 151 +5
Continue to review full report at Codecov.
|
coderd/organizations.go
Outdated
UpdatedAt time.Time `json:"updated_at" validate:"required"` | ||
} | ||
|
||
// convertOrganization consumes the database representation and outputs API friendly. |
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.
// convertOrganization consumes the database representation and outputs API friendly. | |
// convertOrganization consumes the database representation and outputs an API friendly representation. |
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.
Just some minor nits - but overall looks good!
One thing I'm wondering about (that doesn't have to block this PR) - is if Organizations is a feature that isn't part of open-core, maybe we'll eventually have to move these endpoints to the closed/enterprise offering? (whether its through the plugin @ketang is exploring, or another strategy - like the augmentation approach we use to host v2 APIs in v1).
This moves the /user endpoint to /users/me instead. This
will reduce code duplication.
This adds /users//organizations to list organizations
a user has access to. It doesn't contain the permissions a
user has over the organizations, but that will come in a future
contribution.