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
[AC-2303] Implement approveAllRequests method #9031
Conversation
…th-request-api.service
…rganizationModule
…tionAuthRequestService
…onAuthRequestService
…lared in variable
The import path of `PendingAuthRequestView` in `OrganizationAuthRequestApiService` was pointing to the wrong place. I think this file was just recently moved, and the import didn't get updated.
…3/implement-approveallrequests-method
…ccountRecoveryDetails
@addisonbeck Your PR isn't ready yet but this way I can get feedback from you early |
…o ac/ac-2328/bulk-getresetpassworddetails
…3/implement-approveallrequests-method
export class AdminAuthRequestUpdateWithIdRequest extends AdminAuthRequestUpdateRequest { | ||
constructor( | ||
public id: string, | ||
public requestApproved: boolean, | ||
public encryptedUserKey?: string, | ||
) { | ||
super(requestApproved, encryptedUserKey); | ||
} | ||
} |
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.
These property names don't line up with the what the server expects here
I named them the way I did for simplicity, the properties are named that way all the way through to the table object. I'd like to keep the server names if possible and rename these fields in clients. I think you'd just need to avoid extending the existed request model and declaring a new one instead.
The model names are also a bit different, the server one is called OrganizationAuthRequestUpdateManyRequestModel
.
async approvePendingRequests( | ||
organizationId: string, | ||
items: AdminAuthRequestUpdateWithIdRequest[], | ||
): Promise<void> { | ||
await this.apiService.send( | ||
"POST", | ||
`/organizations/${organizationId}/auth-requests/approve`, | ||
new BulkApproveAuthRequestsRequest(items), | ||
true, | ||
false, | ||
); | ||
} | ||
|
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.
The API method is a bit more general purpose than this. It also supports denying auth requests, and is at a slightly different URL. It's the default POST on the organization auth request controller.
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've deleted the BulkApproveAuthRequestsRequest
class and adjusted the endpoint name
…tionAuthRequestUpdateRequest
…3/implement-approveallrequests-method
…dingRequests method
Type of change
Objective
Implement method in Api service to post a request to the server endpoint implemented in bitwarden/server#4077
Code changes
Screenshots
Before you submit