mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
[PM-1349] Update client service to retrieve feature flags from API (#5064)
* [PM-1351] Add property to server-config.response. Change config to be able to fetch without being authed. * [PM-1351] fetch every hour. * [PM-1351] fetch on vault sync. * [PM-1351] browser desktop fetch configs on sync complete. * [PM-1351] Add methods to retrieve feature flags * [PM-1351] Add enum to use as key to get values feature flag values * [PM-1351] Remove debug code * [PM-1351] Get flags when unauthed. Add enums as params. Hourly always fetch. * [PM-1351] add check for authed user using auth service * [PM-1351] remove unnecessary timer on account unlock
This commit is contained in:
@@ -12,6 +12,7 @@ export class ServerConfigData {
|
||||
server?: ThirdPartyServerConfigData;
|
||||
environment?: EnvironmentServerConfigData;
|
||||
utcDate: string;
|
||||
featureStates: { [key: string]: string } = {};
|
||||
|
||||
constructor(serverConfigResponse: Partial<ServerConfigResponse>) {
|
||||
this.version = serverConfigResponse?.version;
|
||||
@@ -23,6 +24,7 @@ export class ServerConfigData {
|
||||
this.environment = serverConfigResponse?.environment
|
||||
? new EnvironmentServerConfigData(serverConfigResponse.environment)
|
||||
: null;
|
||||
this.featureStates = serverConfigResponse?.featureStates;
|
||||
}
|
||||
|
||||
static fromJSON(obj: Jsonify<ServerConfigData>): ServerConfigData {
|
||||
|
||||
@@ -5,6 +5,7 @@ export class ServerConfigResponse extends BaseResponse {
|
||||
gitHash: string;
|
||||
server: ThirdPartyServerConfigResponse;
|
||||
environment: EnvironmentServerConfigResponse;
|
||||
featureStates: { [key: string]: string } = {};
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
@@ -17,6 +18,7 @@ export class ServerConfigResponse extends BaseResponse {
|
||||
this.gitHash = this.getResponseProperty("GitHash");
|
||||
this.server = new ThirdPartyServerConfigResponse(this.getResponseProperty("Server"));
|
||||
this.environment = new EnvironmentServerConfigResponse(this.getResponseProperty("Environment"));
|
||||
this.featureStates = this.getResponseProperty("FeatureStates");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user