Skip to content

Commit 07f9a7c

Browse files
lmfarley10JBAnderson5
authored andcommitted
Initial commit, cleaned sensitive info
1 parent d7b2ca2 commit 07f9a7c

File tree

241 files changed

+26581
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+26581
-1
lines changed

.gitignore

Lines changed: 232 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,235 @@ Temporary Items
3030
.key
3131
.crt
3232
.csr
33-
.pem
33+
.pem
34+
# Dependency directories
35+
/target
36+
/build
37+
/src/dist
38+
/my_package/dist
39+
/my_env
40+
/keys
41+
/curl
42+
43+
/agent-adk/dist
44+
45+
# Python
46+
__pycache__/
47+
*.pyc
48+
*.pyo
49+
*.pyd
50+
*.egg-info
51+
52+
# Images
53+
*.png
54+
*.jpeg
55+
*.jpg
56+
*.gif
57+
*.webp
58+
*.ico
59+
60+
# Config
61+
*.ini
62+
63+
# Binaries
64+
*.xlsx
65+
*.zip
66+
67+
# scan file
68+
.scannerwork/
69+
70+
# Files with possible sensitive info
71+
clientApp/ConfigFile.properties
72+
clientApp/autoprompt/ConfigFile.properties
73+
clientApp/autoprompt/semantic_suggest_runbook.md
74+
75+
# File with reference to orahub repo
76+
mkdocs/mkdocs.yml
77+
78+
# Reference to api gateway
79+
mkdocs/docs/deployment/adw_private.md
80+
81+
# Reference to idcs discovery url
82+
mkdocs/docs/deployment/business_api_gateway.md
83+
84+
# Reference to oda instance
85+
mkdocs/docs/deployment/business_idcs.md
86+
87+
# Reference to oracle redis
88+
mkdocs/docs/deployment/nl2sql_engine.md
89+
90+
# Reference to API GW url
91+
mkdocs/docs/deployment/oda.md
92+
93+
# Reference to OCI tenancy
94+
mkdocs/docs/deployment/trust-service.c.md
95+
mkdocs/docs/deployment/trust-service.md
96+
97+
# Reference to IDCS/API GW
98+
mkdocs/docs/deployment/trust-ui.md
99+
mkdocs/docs/deployment/validation.md
100+
mkdocs/docs/deployment/VBCS.md
101+
102+
# ips
103+
/mkdocs/docs/rest/nl2sql-trust/installation.md
104+
105+
# Reference to OCIDs
106+
/mkdocs/Finetune-DAC/finetune-dac-python.py
107+
108+
# Binaries
109+
/oda/callGenAiSQLEndPointv2(1.0).zip
110+
/oda/websdk2104-desktop.zip
111+
112+
# Not sure about font files ...
113+
/oda/websdk-apache-deploy/fonts/fonnts.com-aptos-semibold.ttf
114+
115+
# node modules
116+
/oda/websdk-apache-deploy/node_modules/
117+
118+
# Random IPs
119+
/oda/websdk-apache-deploy/scripts/settings.js
120+
121+
# I think we should omit web sdk and provide a link to download from public website
122+
/oda/websdk-apache-deploy/scripts/support/*
123+
/oda/websdk-apache-deploy/scripts/web-sdk.js
124+
/oda/websdk-apache-deploy/scripts/web-sdkVnew.js
125+
126+
/oda/websdk2104-desktop/
127+
128+
# Sensitive info
129+
/promotion/
130+
131+
# Random IPs
132+
/rest/nl2sql-trust/conf/dev_trust_config.json
133+
/rest/nl2sql-trust/conf/metadata_v2.json
134+
/rest/nl2sql-trust/conf/trust_config.json
135+
136+
# Sensitive info
137+
/rest/nl2sql-trust/helpers/config_json_helper.py
138+
/rest/nl2sql-trust/helpers/config_json_helper.py
139+
140+
# Reference to genai dedicated cluster
141+
/rest/nl2sql-trust/helpers/finetune_helper.py
142+
143+
# Couldn't find any reference upon first glance, but I imagine there might be if finetune helper has a reference
144+
/rest/nl2sql-trust/helpers/finetune_db.py
145+
146+
# Reference to OCIDs
147+
/rest/nl2sql-trust/helpers/llm_helper.py
148+
/rest/nl2sql-trust/helpers/oci_helper_boostrap.py
149+
/rest/nl2sql-trust/helpers/oci_helper_json.py
150+
151+
/rest/nl2sql-trust/helpers/test_ca_creation.json
152+
153+
# wallet
154+
/rest/nl2sql-trust/wallet/
155+
156+
# Do we need this ?
157+
/rest/nl2sql-trust/htmlcov
158+
159+
# keys
160+
/rest/nl2sql-trust/openssl/
161+
162+
# Wallet
163+
/rest/nl2sql-trust/wallet/nl2sql-test/
164+
165+
/rest/wallet/nl2sql-test
166+
167+
# example ips in comments
168+
/rest/nl2sql-trust/nl2sql_service.py
169+
170+
# Reference to internal db
171+
/rest/nl2sql-trust/README
172+
173+
# devops sensitive info
174+
/rest/script/devops
175+
176+
# docker artifactory info
177+
/rest/script/docker/artifacts
178+
179+
# oracle instant client reference?
180+
/rest/script/docker/oracle-instantclient-23ai-ol8.repo
181+
182+
# tenancy name reference
183+
/rest/script/docker/promote_dev.sh
184+
/rest/script/docker/run_dev.sh
185+
/rest/script/docker/run.sh
186+
187+
/rest/script/docker_released/artifacts
188+
189+
# another oracle instant client reference? Add link to public download instead?
190+
/rest/script/docker_released/oracle-instantclient-23ai-ol8.repo
191+
192+
# tenancy name reference
193+
/rest/script/docker_released/run_dev.sh
194+
/rest/script/docker_released/run.sh
195+
/rest/script/docker_released/Dockerfile
196+
197+
# ubuntu image? Is this needed? Replace with olinux instead?
198+
/rest/script/dockerssh/Dockerfile
199+
200+
# Reference to google apis, twitter open source, do we need this?
201+
/rest/script/html_client/
202+
203+
# old docker I assume is unnecessary?
204+
/rest/script/old_docker/
205+
206+
# bash scripts from ruepprich.com, are these needed?
207+
/rest/script/find_by_freeform.bash
208+
/rest/script/find_by_tags.bash
209+
210+
# log file
211+
/rest/script/nl2sql_trust_rest.log
212+
213+
# sensitive info
214+
/rest/script/os_upload.bash
215+
/rest/script/upload_os_trust_config.sh
216+
217+
# tenancy name reference
218+
/rest/script/nl2sql_rest.service
219+
220+
# ips
221+
/rest/script/upload.sh
222+
223+
# Wallet
224+
/rest/script/wallet/nl2sql-test
225+
226+
# lock file
227+
/rest/poetry.lock
228+
229+
# tenancy namespace
230+
/scripts/oci
231+
232+
# Reference to tenancy
233+
/terraform/cloud-init/nl_engine_cloud_init.yml
234+
terraform/cloud-init/trust-cloud-init.yml
235+
236+
# sensitive info
237+
terraform/example/vm_nl_engine_cloud_init/terraform.tfvars
238+
terraform/example/vm_trust_cloud_init/terraform.tfvars
239+
/terraform/example/vm_nl_engine_cloud_init/nl_engine_cloud_init.yml.tpl
240+
/terraform/example/vm_nl_engine_cloud_init/variables.tf
241+
/terraform/example/vm_trust_cloud_init/variables.tf
242+
# NLSQL_v1 & NLSQL_V2 directories, I assume v1 is unnecessary?
243+
terraform/NLSQL_v1
244+
245+
# Secrets and binaries
246+
terraform/NLSQL_V2/Deployment/config
247+
248+
# ocids
249+
terraform/NLSQL_V2/Deployment/modules/instances/gpu/main.tf
250+
terraform/NLSQL_V2/Deployment/modules/instances/gpu/main.tf
251+
252+
# empty dir
253+
terraform/NLSQL_V2/Deployment/scripts/
254+
255+
# are these archives necessary?
256+
vbcs_oda_archives
257+
258+
# wallet
259+
/wallet
260+
261+
# tenancy reference
262+
/run.sh
263+
264+
.DS_Store

.ignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.pyc
2+
__pycache__/
3+
*.pyo
4+
*.pyd
5+

clientApp/audit_logging.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import datetime
2+
from connect_vector_db import create_db_connection, load_config, close_db_connection
3+
import logging
4+
5+
logger = logging.getLogger("app_logger")
6+
7+
# def log_audit_test_insert():
8+
def log_audit_test_insert(CERTIFIED_SCORE, PROMPT_TXT, SQL_QUERY, DB_RESPONSE_CODE, DB_ERR_TEXT, GENERATION_ENGINE_NM, SQL_LINEAGE, PROMPT_LINEAGE):
9+
connection = None
10+
cursor = None
11+
try:
12+
# Load the database configuration
13+
config_file = 'ConfigFile.properties'
14+
db_config = load_config(config_file)
15+
16+
# Create a database connection using the shared function
17+
connection = create_db_connection(db_config)
18+
cursor = connection.cursor()
19+
20+
# Dummy values to test insert
21+
# EXECUTION_DATE = datetime.datetime.now()
22+
# CERTIFIED_SCORE = 0.85
23+
# PROMPT_TXT = "Test prompt for auditing"
24+
# SQL_QUERY = "SELECT * FROM some_table"
25+
# DB_RESPONSE_CODE = 200
26+
# DB_ERR_TEXT = None # Can also test with some error text, e.g., "Some error occurred"
27+
28+
insert_sql = """
29+
INSERT INTO Executed_Prompts (CERTIFIED_SCORE, PROMPT_TXT, SQL_QUERY, DB_RESPONSE_CODE, DB_ERR_TEXT, GENERATION_ENGINE_NM, SQL_LINEAGE, PROMPT_LINEAGE)
30+
VALUES (:1, :2, :3, :4, :5, :6, :7, :8)
31+
"""
32+
cursor.execute(insert_sql,
33+
(CERTIFIED_SCORE, PROMPT_TXT, SQL_QUERY, DB_RESPONSE_CODE, DB_ERR_TEXT, GENERATION_ENGINE_NM, SQL_LINEAGE, PROMPT_LINEAGE))
34+
connection.commit()
35+
36+
logger.debug("Test insert successful.")
37+
38+
except Exception as e:
39+
logger.debug(f"Error logging audit data: {e}")
40+
finally:
41+
if cursor:
42+
cursor.close()
43+
if connection:
44+
close_db_connection(connection)
45+

0 commit comments

Comments
 (0)