DomainRestrictions Component Documentation
Purpose
The DomainRestrictions component manages the allowed domains for user integrations within the Vantage platform. By restricting the domains from which users can connect their personal integrations, organizations can enhance security and compliance. This feature allows administrators to specify exactly which domains are permitted, ensuring that only approved external services and accounts can be integrated with the Vantage analytics platform.
Settings
The DomainRestrictions component includes several key settings and functionality areas:
1. Allowed Domains
- Input Type: Array of strings
- Description: This setting holds the list of domains that are permitted for user integrations. Users can only connect accounts from the specified domains. Changing this setting directly impacts the security posture concerning which services can access the Vantage platform.
- Default Value: An empty array (i.e.,
[]), meaning no domains are restricted, and users can connect accounts from any domain.
2. Domain Input
- Input Type: String
- Description: Represents the current input for adding a new domain. Users can type in a domain name into this field. The component processes this input to ensure that it is allowed for the domains list.
- Default Value: An empty string (i.e.,
'').
3. Saving State
- Input Type: Boolean
- Description: Represents whether the domains are currently being saved to the backend. This state controls the display of a loading indicator while a save operation is in progress.
- Default Value:
false, indicating that no save operation is occurring.
4. Saved State
- Input Type: Boolean
- Description: Indicates whether the latest changes to the domain list have been successfully saved. This can trigger visual feedback for the user (like a "Saved" message) confirming that their input has been acknowledged.
- Default Value:
false, meaning that no changes have been saved yet.
5. Loading State
- Input Type: Boolean
- Description: Represents whether the component is currently loading data from the backend. This state affects the appearance by displaying a loading spinner until the data has been retrieved and processed.
- Default Value:
true, indicating that the component starts in a loading state while it fetches the allowed domains.
How It Works
-
Initialization: On component mount, an asynchronous operation fetches the current list of allowed domains from the backend API (
/api/integrations/domain-restrictions). If successful, the list is stored in theallowedDomainsstate. The loading state is set tofalseonce the data is loaded. -
Adding Domains: The user enters a domain in the input field and clicks the "Add" button or presses the Enter key. The system converts the input to lowercase, trims whitespace, and checks for its uniqueness. If the domain is valid and not already in the list, it is added to
allowedDomains, and the updated list is saved to the backend. -
Removing Domains: Users can remove an existing domain by clicking the "X" button next to the domain name. This triggers a re-fetch from the
allowedDomainsprocess, ensuring real-time updates. -
Data Sync: Changes to the
allowedDomainsstate are reflected both in the UI and stored persistently via the backend API to ensure updates are saved across sessions.
Use Cases & Examples
Use Case 1: Security Compliance for Organizations
An organization that handles sensitive data can use the DomainRestrictions feature to ensure that only approved cloud services (e.g., company-approved analytics tools) can connect to their Vantage instance.
Use Case 2: Managing Third-Party Integrations
A company with multiple vendor contracts might want to restrict access to only their business partner domains, ensuring that integrations are limited to trusted entities.
Example Configuration
Business Scenario: Restrict Integrations to Approved Vendors
Configuration Steps:
- The administrator logs into the Vantage platform and navigates to the
DomainRestrictionssection. - They enter the domains to be restricted, e.g.,
vendor1.com,vendor2.com, andvendor3.com.
Sample Configuration Data:
{
"domains": [
"vendor1.com",
"vendor2.com",
"vendor3.com"
]
}Outcome: After saving, only accounts registered with these domains will be able to integrate with Vantage. If a user attempts to connect an account from unauthorized.com, the system will deny access, thereby enhancing the security and integrity of data within the platform.