-
Notifications
You must be signed in to change notification settings - Fork 392
passkey config admin changes #2326
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
Open
pragatimodi
wants to merge
30
commits into
master
Choose a base branch
from
passkeys
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
629f8ac
passkey config admin changes
pragatimodi a2c2431
Bug Fix for issue #2320 (#2321)
rishabhAjay 62b0003
fixed unit test errors
dependabot[bot] f0b0ea6
lint fixes + integration
dependabot[bot] ac9a82f
remove integration tests
pragatimodi b40b1ab
adding comments
pragatimodi b35cb33
undo package json changes
pragatimodi 8bd4d39
Merge branch 'master' into passkeys
pragatimodi 5c16959
passkey config admin changes
pragatimodi 218e7d3
fixed unit test errors
dependabot[bot] 0977e7a
lint fixes + integration
dependabot[bot] dfe7f4a
remove integration tests
pragatimodi 1bb1526
undo package json changes
pragatimodi abfb295
adding comments
pragatimodi 045d959
Merge branch 'passkeys' of https://github.com/firebase/firebase-admin…
pragatimodi fff81ce
undo package json changes
pragatimodi 9d69dd8
undo package json changes
pragatimodi 7127be9
Merge branch 'passkeys' of https://github.com/firebase/firebase-admin…
pragatimodi 1ab9273
undo duplicate npm changes
pragatimodi c294ff4
Apply suggestions from code review
pragatimodi 6492438
update toJSON for string values
pragatimodi f9d35c3
Merge branch 'master' into passkeys
pragatimodi 041bf17
user record changes for getAccountInfo() (#2341)
pragatimodi 0389dc1
correct endpoint
pragatimodi 5364938
fix tenant endpoint handling
pragatimodi 8d3384b
fix lint
pragatimodi cec0cbe
add api:extractor changes
pragatimodi 2c70e61
remove uncommented code
pragatimodi 64203c3
Merge branch 'master' into passkeys
pragatimodi bf58ff0
Merge branch 'master' into passkeys
pragatimodi 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,85 @@ | ||
/*! | ||
* Copyright 2023 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 { | ||
AuthRequestHandler, | ||
} from './auth-api-request'; | ||
import { | ||
PasskeyConfig, | ||
PasskeyConfigClientRequest, | ||
PasskeyConfigRequest, | ||
PasskeyConfigServerResponse | ||
} from './passkey-config'; | ||
|
||
/** | ||
* Manages Passkey configuration for a Firebase app. | ||
*/ | ||
export class PasskeyConfigManager { | ||
private readonly authRequestHandler: AuthRequestHandler; | ||
|
||
/** | ||
* Initializes a PasskeyConfigManager instance for a specified FirebaseApp. | ||
* | ||
* @param app - The Firebase app associated with this PasskeyConfigManager instance. | ||
* | ||
* @constructor | ||
* @internal | ||
*/ | ||
constructor(app: App) { | ||
this.authRequestHandler = new AuthRequestHandler(app); | ||
} | ||
|
||
/** | ||
* Retrieves the Passkey Configuration. | ||
pragatimodi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @param tenantId - (optional) The tenant ID if querying passkeys on a specific tenant. | ||
* @returns A promise fulfilled with the passkey configuration. | ||
*/ | ||
public getPasskeyConfig(tenantId?: string): Promise<PasskeyConfig> { | ||
return this.authRequestHandler.getPasskeyConfig(tenantId) | ||
.then((response: PasskeyConfigServerResponse) => { | ||
return new PasskeyConfig(response); | ||
}); | ||
} | ||
|
||
/** | ||
* Creates a new passkey configuration. | ||
* | ||
* @param passkeyConfigRequest - Configuration details for the passkey. | ||
* @param tenantId - (optional) The tenant ID for which the passkey config is created. | ||
* @returns A promise fulfilled with the newly created passkey configuration. | ||
*/ | ||
public createPasskeyConfig(passkeyConfigRequest: PasskeyConfigRequest, tenantId?: string): Promise<PasskeyConfig> { | ||
return this.authRequestHandler.updatePasskeyConfig(true, tenantId, passkeyConfigRequest) | ||
.then((response: PasskeyConfigClientRequest) => { | ||
return new PasskeyConfig(response); | ||
}); | ||
} | ||
|
||
/** | ||
* Updates an existing passkey configuration. | ||
* | ||
* @param passkeyConfigRequest - Updated configuration details for the passkey. | ||
* @param tenantId - (optional) The tenant ID for which the passkey config is updated. | ||
* @returns A promise fulfilled with the updated passkey configuration. | ||
*/ | ||
public updatePasskeyConfig(passkeyConfigRequest: PasskeyConfigRequest, tenantId?: string): Promise<PasskeyConfig> { | ||
return this.authRequestHandler.updatePasskeyConfig(false, tenantId, passkeyConfigRequest) | ||
.then((response: PasskeyConfigClientRequest) => { | ||
return new PasskeyConfig(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.
Uh oh!
There was an error while loading. Please reload this page.