omnata-plugin-devkit 0.10.16a108__py3-none-any.whl → 0.10.16a110__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,7 @@ import sys
20
20
  import typing
21
21
  import zipfile
22
22
  import copy
23
+ import uuid
23
24
  from pathlib import Path
24
25
  from typing import Any, Dict, List, Literal, Optional
25
26
 
@@ -619,6 +620,28 @@ $${}$$;
619
620
  FROM '/streamlit'
620
621
  MAIN_FILE = '/plugin_configuration.py';"""
621
622
  )
623
+
624
+ setup_script.write("""
625
+ WITH CREATE_TOKEN_FUNCTION AS PROCEDURE()
626
+ RETURNS BOOLEAN
627
+ LANGUAGE JAVASCRIPT
628
+ AS
629
+ $$
630
+ var uuidStatement = snowflake.createStatement({ sqlText:
631
+ `select UUID_STRING();`
632
+ });
633
+ var uuidResult = uuidStatement.execute();
634
+ uuidResult.next();
635
+ var uuid = uuidResult.getColumnValue(1);
636
+ var twoDollars='$' + '$';
637
+ snowflake.createStatement({ sqlText:
638
+ `create or replace function PLUGIN.TOKEN() returns string as ${twoDollars}'${uuid}'${twoDollars} `
639
+ }).execute();
640
+ return true;
641
+ $$
642
+ CALL CREATE_TOKEN_FUNCTION();
643
+ GRANT USAGE ON FUNCTION PLUGIN.TOKEN() TO application role OMNATA_MANAGEMENT;
644
+ """)
622
645
 
623
646
  setup_script.write(
624
647
  """GRANT USAGE ON STREAMLIT UI."Plugin Configuration" TO application role OMNATA_MANAGEMENT;\n"""
@@ -653,6 +676,15 @@ MAIN_FILE = '/plugin_configuration.py';"""
653
676
  }
654
677
  )
655
678
  manifest_file.write(content)
679
+ custom_manifest_privileges = os.path.join(plugin_directory, "custom_manifest_privileges.yml")
680
+ if os.path.exists(custom_manifest_privileges):
681
+ print("Adding manifest privileges from custom_manifest_privileges.yml")
682
+ with open(
683
+ custom_manifest_privileges, "r", encoding="utf-8"
684
+ ) as custom_manifest_privileges_stream:
685
+ setup_script.write(custom_manifest_privileges_stream.read() + "\n")
686
+
687
+
656
688
  print("Uploading app manifest to stage")
657
689
  self.session.sql(
658
690
  (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: omnata-plugin-devkit
3
- Version: 0.10.16a108
3
+ Version: 0.10.16a110
4
4
  Summary:
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -45,7 +45,7 @@ omnata_plugin_devkit/plugin_template/icon.svg,sha256=xEXOqutQhh8JaKU3xgyx9Weq1Kw
45
45
  omnata_plugin_devkit/plugin_template/plugin.py,sha256=VI2J64tRvrwuUbCHaB7SCO-QMisyeO1qTlamr9me_iM,15465
46
46
  omnata_plugin_devkit/plugin_template/plugin_development.ipynb,sha256=8_rkQnwWKe31MQp2rbM4ySjtET3FlAQcJVW8ix5Bh50,2912
47
47
  omnata_plugin_devkit/plugin_template/requirements.txt,sha256=nWMMGhIC_HIZHWTImksSLNU9mIAh0HlQHFVAS0rUKnA,30
48
- omnata_plugin_devkit/plugin_uploader.py,sha256=2Nl1UK5o5VwHWmcQtz5u2LaMC836ZSsK8VOYz5aIr5E,41053
48
+ omnata_plugin_devkit/plugin_uploader.py,sha256=r30KQO-8LEb5PXcqN_fVoE1IxWbybfGa3uUHuhgli3Q,42247
49
49
  omnata_plugin_devkit/snowcli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  omnata_plugin_devkit/snowcli/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  omnata_plugin_devkit/snowcli/cli/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -70,7 +70,7 @@ omnata_plugin_devkit/snowcli/cli/templates/environment.yml.jinja,sha256=LRT00o5J
70
70
  omnata_plugin_devkit/streamlit/plugin_configuration.py,sha256=k89uspeQ_t5_Wbb_aXRL-fvbypXtax_r40oxxqB6fKc,100172
71
71
  omnata_plugin_devkit/test_step_definitions.py,sha256=Und60RpAn0YcJn-i1FpzUzVHRPnDB5QqO6YnZm2l6aw,53205
72
72
  omnata_plugin_devkit/utils.py,sha256=pFUltWEcb7Wxq0TPUdjvNPZG0AXHVrU-fZ874Q-EgUU,1378
73
- omnata_plugin_devkit-0.10.16a108.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
74
- omnata_plugin_devkit-0.10.16a108.dist-info/METADATA,sha256=mStInXbSRHO_gzjVOD0C0c6peo6FvkSi6YaKzkY8sZ8,1192
75
- omnata_plugin_devkit-0.10.16a108.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
76
- omnata_plugin_devkit-0.10.16a108.dist-info/RECORD,,
73
+ omnata_plugin_devkit-0.10.16a110.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
74
+ omnata_plugin_devkit-0.10.16a110.dist-info/METADATA,sha256=QR7n6l7Gi3oQIkpjHVlHWKQcT6J43dp_6K-qBrLG_Hk,1192
75
+ omnata_plugin_devkit-0.10.16a110.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
76
+ omnata_plugin_devkit-0.10.16a110.dist-info/RECORD,,