-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Expose local storage through access control facility (#3299)
* wip: local storage access control Signed-off-by: Trae Yelovich <[email protected]> * wip: support workspace opts in local storage; move ACL checks Signed-off-by: Trae Yelovich <[email protected]> * wip: migrating workspace settings into workspaceState Signed-off-by: Trae Yelovich <[email protected]> * add typedoc to LocalStorageAccess, export key type Signed-off-by: Trae Yelovich <[email protected]> * resolve failing tests & remove unused import Signed-off-by: Trae Yelovich <[email protected]> * tests: cases for SettingsConfig.migrateSettingsAtLevel Signed-off-by: Trae Yelovich <[email protected]> * SettingsConfig.migrateSettingsAtLevel: typedoc, await setters Signed-off-by: Trae Yelovich <[email protected]> * chore: add changelog entry for workspace fix Signed-off-by: Trae Yelovich <[email protected]> * bump patch coverage Signed-off-by: Trae Yelovich <[email protected]> * make LocalStorageAccess static, run l10n Signed-off-by: Trae Yelovich <[email protected]> * create interface in API to represent access facility Signed-off-by: Trae Yelovich <[email protected]> * chore: update API changelog Signed-off-by: Trae Yelovich <[email protected]> * pass workspaceState to ZoweLocalStorage init Signed-off-by: Trae Yelovich <[email protected]> * fix: use defaultValue undefined for workspaceState access Signed-off-by: Trae Yelovich <[email protected]> * run prettier Signed-off-by: Trae Yelovich <[email protected]> --------- Signed-off-by: Trae Yelovich <[email protected]>
- Loading branch information
Showing
33 changed files
with
419 additions
and
58 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
38 changes: 38 additions & 0 deletions
38
packages/zowe-explorer-api/src/extend/ILocalStorageAccess.ts
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,38 @@ | ||
/** | ||
* This program and the accompanying materials are made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Copyright Contributors to the Zowe Project. | ||
* | ||
*/ | ||
|
||
export interface ILocalStorageAccess { | ||
/** | ||
* @returns The list of readable keys from the access facility | ||
*/ | ||
getReadableKeys(): string[]; | ||
|
||
/** | ||
* @returns The list of writable keys from the access facility | ||
*/ | ||
getWritableKeys(): string[]; | ||
|
||
/** | ||
* Retrieve the value from local storage for the given key. | ||
* @param key A readable key | ||
* @returns The value if it exists in local storage, or `undefined` otherwise | ||
* @throws If the extender does not have appropriate read permissions for the given key | ||
*/ | ||
getValue<T>(key: string): T; | ||
|
||
/** | ||
* Set a value in local storage for the given key. | ||
* @param key A writable key | ||
* @param value The new value for the given key to set in local storage | ||
* @throws If the extender does not have appropriate write permissions for the given key | ||
*/ | ||
setValue<T>(key: string, value: T): Thenable<void>; | ||
} |
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
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
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
Oops, something went wrong.