Skip to content

prepwork for retrieving client configuration (OrgRules) from FES #339

@tomholub

Description

@tomholub

part of #275
after this, you may do #340
after that can do #276

FES = FlowCrypt Enterprise Server https://flowcrypt.com/docs/technical/enterprise-server/latest/enterprise-server.html

Flow:

  1. parse out user domain: user@example.com -> example.com
  2. skip all following steps if user is on public email domain (@ gmail, @ outlook)
  3. call GET https://fes.$domain/api/ (no authentication) for example GET https://fes.corp.com/api/. If it returns a 404 or the server cannot be reached within 4 seconds, skip following steps (similar failure handling to WKD policy call)
  4. make sure that the response contains json parameter service which must equal enterprise-server. If it shows something else or this is not contained, show an error.
  5. show a toast message that says FES at $url not supported on iOS yet

The class that does steps 1-4 should be EnterpriseServerApiClient eg a method func getActiveFesUrl(for email: String): Promise<String?> (nil if no FES runs there, else url of the server).

Do the above during setup immediately after authentication (once you know user email address)

You can test this flow using your Google account at flowcrypt.com domain which I'll send you. Here is the API that you will be calling in that case: https://fes.flowcrypt.com/api/ but of course the domain is dynamic, so you may be calling another URL if you used account on another domain.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions