generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PM-12405] Added new endpoint for Organization SSO verified domains (#…
- Loading branch information
Showing
26 changed files
with
430 additions
and
16 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
BitwardenShared/Core/Auth/Models/Request/SingleSignOnDomainsVerifiedRequestModel.swift
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,13 @@ | ||
import Foundation | ||
import Networking | ||
|
||
// MARK: - SingleSignOnDomainsVerifiedRequestModel | ||
|
||
/// API request model for getting the single sign on verified domains of a user from their email. | ||
/// | ||
struct SingleSignOnDomainsVerifiedRequestModel: JSONRequestBody { | ||
// MARK: Properties | ||
|
||
/// The email of the user to check for single sign on details of. | ||
let email: String | ||
} |
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
37 changes: 37 additions & 0 deletions
37
BitwardenShared/Core/Auth/Models/Response/SingleSignOnDomainsVerifiedResponse.swift
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,37 @@ | ||
import Foundation | ||
import Networking | ||
|
||
// MARK: - SingleSignOnDomainsVerifiedResponse | ||
|
||
/// The response returned from the API when requesting the single sign on verified domains. | ||
/// | ||
struct SingleSignOnDomainsVerifiedResponse: JSONResponse, Equatable { | ||
// MARK: Types | ||
|
||
/// Key names used for encoding and decoding. | ||
enum CodingKeys: String, CodingKey { | ||
case verifiedDomains = "data" | ||
} | ||
|
||
// MARK: Properties | ||
|
||
/// The verified domains for the organization single sign on. | ||
let verifiedDomains: [SingleSignOnDomainVerifiedDetailResponse]? | ||
} | ||
|
||
/// The response returned from the API when requesting the single sign on verified domain for a specific domain. | ||
/// | ||
struct SingleSignOnDomainVerifiedDetailResponse: JSONResponse, Equatable { | ||
static let decoder = JSONDecoder.pascalOrSnakeCaseDecoder | ||
|
||
// MARK: Properties | ||
|
||
/// The domain name. | ||
let domainName: String? | ||
|
||
/// The organization identifier for the user. | ||
let organizationIdentifier: String? | ||
|
||
/// The organization name. | ||
let organizationName: String? | ||
} |
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
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
5 changes: 5 additions & 0 deletions
5
BitwardenShared/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDetails.json
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,5 @@ | ||
{ | ||
"OrganizationIdentifier": "TeamLivefront", | ||
"SsoAvailable": true, | ||
"VerifiedDate": "2000-01-01T00:00:00.00Z" | ||
} |
4 changes: 4 additions & 0 deletions
4
BitwardenShared/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDetailsNoOrgId.json
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,4 @@ | ||
{ | ||
"SsoAvailable": true, | ||
"VerifiedDate": "2000-01-01T00:00:00.00Z" | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
"OrganizationIdentifier": "TeamLivefront", | ||
"SsoAvailable": true | ||
} | ||
|
5 changes: 5 additions & 0 deletions
5
...nShared/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDetailsNotAvailable.json
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,5 @@ | ||
{ | ||
"OrganizationIdentifier": "TeamLivefront", | ||
"SsoAvailable": false, | ||
"VerifiedDate": "2000-01-01T00:00:00.00Z" | ||
} |
5 changes: 5 additions & 0 deletions
5
...denShared/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDetailsOrgIdEmpty.json
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,5 @@ | ||
{ | ||
"OrganizationIdentifier": "", | ||
"SsoAvailable": true, | ||
"VerifiedDate": "2000-01-01T00:00:00.00Z" | ||
} |
9 changes: 9 additions & 0 deletions
9
...ardenShared/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDomainsVerified.json
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,9 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"OrganizationName": "TestName", | ||
"OrganizationIdentifier": "TestID", | ||
"DomainName": "domain" | ||
} | ||
] | ||
} |
4 changes: 4 additions & 0 deletions
4
...ed/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDomainsVerifiedEmptyData.json
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,4 @@ | ||
{ | ||
"data": [ | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
...d/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDomainsVerifiedEmptyOrgId.json
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,9 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"OrganizationName": "TestName", | ||
"OrganizationIdentifier": "", | ||
"DomainName": "domain" | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
...red/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDomainsVerifiedMultiple.json
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,14 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"OrganizationName": "TestName", | ||
"OrganizationIdentifier": "TestID", | ||
"DomainName": "domain" | ||
}, | ||
{ | ||
"OrganizationName": "Org2", | ||
"OrganizationIdentifier": "TestOrg2", | ||
"DomainName": "domain" | ||
} | ||
] | ||
} |
2 changes: 2 additions & 0 deletions
2
...hared/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDomainsVerifiedNoData.json
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,2 @@ | ||
{ | ||
} |
8 changes: 8 additions & 0 deletions
8
...ared/Core/Auth/Services/API/Organization/Fixtures/SingleSignOnDomainsVerifiedNoOrgId.json
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,8 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"OrganizationName": "TestName", | ||
"DomainName": "domain" | ||
} | ||
] | ||
} |
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
Oops, something went wrong.