-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project config - Recaptcha config (#1595)
* Recaptcha config changes in project config. - Implemented getProjectConfig. - Implemented updateProjectConfig. - Updated error code. - Add Term of Service consents.
- Loading branch information
1 parent
0d1a56f
commit c01f7fb
Showing
11 changed files
with
730 additions
and
13 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/*! | ||
* Copyright 2022 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { App } from '../app'; | ||
import { ProjectConfig, ProjectConfigServerResponse, UpdateProjectConfigRequest } from './project-config'; | ||
import { | ||
AuthRequestHandler, | ||
} from './auth-api-request'; | ||
|
||
/** | ||
* Defines the project config manager used to help manage project config related operations. | ||
* This includes: | ||
* <ul> | ||
* <li>The ability to update and get project config.</li> | ||
*/ | ||
export class ProjectConfigManager { | ||
private readonly authRequestHandler: AuthRequestHandler; | ||
|
||
/** | ||
* Initializes a ProjectConfigManager instance for a specified FirebaseApp. | ||
* | ||
* @param app - The app for this ProjectConfigManager instance. | ||
* | ||
* @constructor | ||
* @internal | ||
*/ | ||
constructor(app: App) { | ||
this.authRequestHandler = new AuthRequestHandler(app); | ||
} | ||
|
||
/** | ||
* Get the project configuration. | ||
* | ||
* @returns A promise fulfilled with the project configuration. | ||
*/ | ||
public getProjectConfig(): Promise<ProjectConfig> { | ||
return this.authRequestHandler.getProjectConfig() | ||
.then((response: ProjectConfigServerResponse) => { | ||
return new ProjectConfig(response); | ||
}) | ||
} | ||
/** | ||
* Updates an existing project configuration. | ||
* | ||
* @param projectConfigOptions - The properties to update on the project. | ||
* | ||
* @returns A promise fulfilled with the update project config. | ||
*/ | ||
public updateProjectConfig(projectConfigOptions: UpdateProjectConfigRequest): Promise<ProjectConfig> { | ||
return this.authRequestHandler.updateProjectConfig(projectConfigOptions) | ||
.then((response: ProjectConfigServerResponse) => { | ||
return new ProjectConfig(response); | ||
}) | ||
} | ||
} |
Oops, something went wrong.