-
Notifications
You must be signed in to change notification settings - Fork 672
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
MG-1962 - Add single endpoint to change status of domain #2127
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.
Please sign-off your commits (check DCO report) and fix CI.
c8fe404
to
417666b
Compare
@dborovcanin and @arvindh123 please review this one |
/domains/{domainID}/disable: | ||
post: | ||
summary: Disable a domain | ||
/domains/{domainID}/status: |
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.
Why is important to have one endpoint? It looks more self-documenting to me that way, than having sing status
endpoint - which usually prompt me that it is status indicator (i.e. something I would use with GET
to fetch the current status), and not a control switch.
@@ -349,6 +349,25 @@ func (lm *loggingMiddleware) CreateDomain(ctx context.Context, token string, d a | |||
return lm.svc.CreateDomain(ctx, token, d) | |||
} | |||
|
|||
func (lm *loggingMiddleware) DeleteDomain(ctx context.Context, token string, d auth.Domain) (err 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.
Probably deletion was avoided for now because of cascade consequences - @dborovcanin must confirm. But probably you'll need to remove all resources related to this domain (things, channels, ...) once you decide to remove a specific domain.
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.
@drasko This is correct, it requires a careful analysis due to the cascade nature of removal.
417666b
to
083d67a
Compare
@arvindh123 Please review this one. |
9f58fc1
to
1cb281f
Compare
Signed-off-by: Janael Pinheiro <ajp@cesar.org.br>
After this comment and an internal discussion between the maintainer and due to the inactivity of this pull request, we decided to close this PR and linked issue, since we will keep the current approach. Both approaches diverge from the usual REST principle, the current one (with 3 endpoints) being less prone to errors and a little more verbose. @janael-pinheiro Thanks for the contribution and effort you put into this pull request. |
What type of PR is this?
This is a feature because it adds the following functionality: adds a single endpoint to change domain status and an endpoint to remove domain.
What does this do?
removes the
/domains/{domainID}/enabled
,/domains/{domainID}/disabled
, and/domains/{domainID}/freezed
endpoints. Adds the/domains/{domainID}/status
(HTTP PUT) endpoint that concentrates domain status change operations. Additionally, it adds the/domains/{domainID}
(HTTP DELETE) endpoint to remove a specific domain.Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Yes, I have included tests for my changes. I added tests to evaluate the behavior of the new endpoints (
/domains/{domainID}/status
and/domains/{domainID}
).Did you document any new/modified feature?
Yes, I have updated the documentation for the new feature. Yes, I updated the
api/openapi/auth.yml
fileNotes