Skip to content
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

fix: Use user permissions for iframes instead of query parameters #1400

Merged
merged 6 commits into from
Jul 7, 2023

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Jul 6, 2023

Tested by setting the following in the dh-defaults.prop and verified the functionality matched with what I set:

diff --git a/props/configs/src/main/resources/dh-defaults.prop b/props/configs/src/main/resources/dh-defaults.prop
index 502ad119c4..65080d03db 100644
--- a/props/configs/src/main/resources/dh-defaults.prop
+++ b/props/configs/src/main/resources/dh-defaults.prop
@@ -55,7 +55,7 @@ authentication.anonymous.warn=true
 authentication.client.configuration.list=AuthHandlers
 
 # List of configuration properties to provide to authenticated clients, so they can interact with the server.
-client.configuration.list=java.version,deephaven.version,barrage.version,http.session.durationMs
+client.configuration.list=java.version,deephaven.version,barrage.version,http.session.durationMs,internal.webClient.appInit.canCopy,internal.webClient.appInit.canDownloadCsv
 # Version list to add to the configuration property list. Each `=`-delimited pair denotes a short name for a versioned
 # jar, and a class that is found in that jar. Any such keys will be made available to the client.configuration.list
 # as <key>.version.
@@ -64,3 +64,6 @@ client.version.list=deephaven=io.deephaven.engine.table.Table,barrage=io.deephav
 
 # Specifies additional setup to run on threads that can perform table operations with user code. Comma-separated list, instances must be of type io.deephaven.util.thread.ThreadInitializationFactory
 thread.initialization=io.deephaven.server.console.python.DebuggingInitializer
+
+# internal.webClient.appInit.canCopy=false
+internal.webClient.appInit.canDownloadCsv=false
\ No newline at end of file

- Added tests for it as well
- Updated the embed readmes to link to Application mode correctly
- Now after the user has completed authentication, the user context is also bootstrapped
- Wired up in embed-grid, and got rid of the canCopy/canDownloadCsv query parameters
@mofojed mofojed requested a review from mattrunyon July 6, 2023 18:58
@mofojed mofojed self-assigned this Jul 6, 2023
@mofojed mofojed added this to the July 2023 milestone Jul 6, 2023
@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Merging #1400 (35f9fd6) into main (3a89bbf) will increase coverage by 0.11%.
The diff coverage is 85.48%.

@@            Coverage Diff             @@
##             main    #1400      +/-   ##
==========================================
+ Coverage   45.59%   45.70%   +0.11%     
==========================================
  Files         506      511       +5     
  Lines       34997    35061      +64     
  Branches     8748     8763      +15     
==========================================
+ Hits        15956    16026      +70     
+ Misses      18990    18984       -6     
  Partials       51       51              
Flag Coverage Δ
unit 45.70% <85.48%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/app-utils/src/components/AppBootstrap.tsx 87.50% <ø> (ø)
packages/app-utils/src/components/useUser.ts 0.00% <0.00%> (ø)
packages/code-studio/src/main/AppInit.tsx 0.00% <0.00%> (ø)
...shboard-core-plugins/src/prop-types/UIPropTypes.ts 100.00% <ø> (ø)
...app-utils/src/components/ServerConfigBootstrap.tsx 91.30% <91.30%> (ø)
packages/auth-plugins/src/UserUtils.ts 92.00% <92.00%> (ø)
...ackages/app-utils/src/components/UserBootstrap.tsx 100.00% <100.00%> (ø)
...ckages/app-utils/src/components/useServerConfig.ts 100.00% <100.00%> (ø)
packages/auth-plugins/src/UserContexts.ts 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

packages/app-utils/src/components/useUser.ts Outdated Show resolved Hide resolved
packages/auth-plugins/src/UserUtils.test.ts Outdated Show resolved Hide resolved
packages/auth-plugins/src/UserUtils.ts Show resolved Hide resolved
packages/auth-plugins/src/UserUtils.ts Outdated Show resolved Hide resolved
packages/auth-plugins/src/UserUtils.ts Outdated Show resolved Hide resolved
packages/auth-plugins/src/UserUtils.ts Outdated Show resolved Hide resolved
packages/auth-plugins/src/UserUtils.ts Outdated Show resolved Hide resolved
packages/auth-plugins/src/UserUtils.ts Outdated Show resolved Hide resolved
- Remove Enterprise permissions from the community user permissions
- Clean up how we retrieved a boolean value in tests
- Fix error message
@mofojed mofojed requested a review from mattrunyon July 7, 2023 13:53
@mofojed mofojed requested a review from mattrunyon July 7, 2023 17:14
@mofojed mofojed enabled auto-merge (squash) July 7, 2023 17:20
@mofojed mofojed merged commit 8cf2bbd into deephaven:main Jul 7, 2023
@mofojed mofojed deleted the 1337-fix-iframe-permissions branch July 7, 2023 17:25
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Features available for iframes are not the same as the ide by default
2 participants