-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project config - Recaptcha config #1595
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
817b61e
Recaptcha config changes in project config.
Xiaoshouzi-gh 86a788e
Refactor ProjectConfig to accommodate backend API scheme changes.
Xiaoshouzi-gh ab4aac6
code cleanup
Xiaoshouzi-gh f4d0839
address PR feedbacks
Xiaoshouzi-gh 0b9033c
rename tenantMgmtResourceBuilder to authResouceUrlBuilder
Xiaoshouzi-gh 657ab8d
minor changes
Xiaoshouzi-gh acda70f
add legal consent for enabling recaptcha config
Xiaoshouzi-gh 0d55d4a
Add Tos link to documentation
Xiaoshouzi-gh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we expose GetProjectConfigRequest here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a getProjectConfigRequest. It takes an empty object.