-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new SSO verified domain call and added calling of it behind fea…
…ture flag.
- Loading branch information
1 parent
bf042ef
commit adbefd3
Showing
6 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...ctions/organization-domain/responses/verified-organization-domain-sso-details.response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { BaseResponse } from "@bitwarden/common/models/response/base.response"; | ||
|
||
export class VerifiedOrganizationDomainSsoDetailsResponse extends BaseResponse { | ||
organizationName: string; | ||
organizationIdentifier: string; | ||
domainName: string; | ||
|
||
constructor(response: any) { | ||
super(response); | ||
|
||
this.organizationName = this.getResponseProperty("organizationName"); | ||
this.organizationIdentifier = this.getResponseProperty("organizationIdentifier"); | ||
this.domainName = this.getResponseProperty("domainName"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,12 @@ const mockedOrganizationDomainSsoDetailsServerResponse = { | |
verifiedDate: "2022-12-16T21:36:28.68Z", | ||
}; | ||
|
||
const mockedVerifiedOrganizationDomainSsoDetailsServerResponse = { | ||
organizationIdentifier: "fake-org-identifier", | ||
organizationName: "fake-org", | ||
domainName: "fake-domain-name", | ||
}; | ||
|
||
const mockedOrganizationDomainSsoDetailsResponse = new OrganizationDomainSsoDetailsResponse( | ||
mockedOrganizationDomainSsoDetailsServerResponse, | ||
); | ||
|
@@ -229,4 +235,21 @@ describe("Org Domain API Service", () => { | |
|
||
expect(result).toEqual(mockedOrganizationDomainSsoDetailsResponse); | ||
}); | ||
|
||
it("getVerifiedOrgDomainsByEmail should call ApiService.send with correct parameters and return response", async () => { | ||
const email = "[email protected]"; | ||
apiService.send.mockResolvedValue(mockedVerifiedOrganizationDomainSsoDetailsServerResponse); | ||
|
||
const result = await orgDomainApiService.getVerifiedOrgDomainsByEmail(email); | ||
|
||
expect(apiService.send).toHaveBeenCalledWith( | ||
"POST", | ||
"/organizations/domain/sso/verified", | ||
new OrganizationDomainSsoDetailsRequest(email), | ||
false, //anonymous | ||
true, | ||
); | ||
|
||
expect(result).toEqual(mockedVerifiedOrganizationDomainSsoDetailsServerResponse); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters