Skip to content

Commit f6af9ef

Browse files
(DOCSP-22881) Add Java FLE-2 Applications (#1272)
* adding java fle-2 app * wip * successfully running java sample apps, contains unclosed threads * auto format intellij * fix warnings * add java fle-2 sample apps * Trigger Build * remove target directory * remove unused files * cc - feedback * remove test dir
1 parent 5f8b74e commit f6af9ef

File tree

52 files changed

+2559
-67
lines changed

Some content is hidden

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

52 files changed

+2559
-67
lines changed

source/includes/sample_apps/csfle/build.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,46 @@
55
from const import *
66

77

8-
def get_commands(language, get_file_name, state):
9-
"""Get list of commands to build language/state pair"""
10-
file_path = os.path.join(language, get_file_name(language))
8+
def get_commands(project, get_file_name, state):
9+
"""Get list of commands to build project/state pair"""
10+
file_path = os.path.join(project, get_file_name(project))
1111
output_file = os.path.join(
1212
BUILD_DIR,
13-
language,
13+
project,
1414
*state.split(DIR_SEPERATOR),
15-
os.path.dirname(get_file_name(language)),
15+
os.path.dirname(get_file_name(project)),
1616
)
1717
commands = [
1818
f"{BLUEHAWK} copy {file_path} --state {state} -o {output_file}"
1919
]
20-
if GET_EXTRA_FILES(language):
21-
for l in GET_EXTRA_FILES(language):
22-
next_file_name = os.path.join(language, l)
20+
if GET_EXTRA_FILES(project):
21+
for l in GET_EXTRA_FILES(project):
22+
next_file_name = os.path.join(project, l)
2323
next_output_file = os.path.join(
24-
BUILD_DIR, language, *state.split(DIR_SEPERATOR), os.path.dirname(l)
24+
BUILD_DIR, project, *state.split(DIR_SEPERATOR), os.path.dirname(l)
2525
)
26-
commands.append(f"{BLUEHAWK} copy {next_file_name} -o {next_output_file}")
26+
commands.append(f"{BLUEHAWK} copy {next_file_name} --state {state} -o {next_output_file}")
2727
return commands
2828

2929

30-
def build_languages(language, build_states):
31-
"""Build sample apps for a language"""
30+
def build_projects(project, build_states):
31+
"""Build sample apps for a project"""
3232

3333
all_commands = []
3434

3535
for f in BUILD_FILES:
3636
for s in build_states:
37-
commands = get_commands(language, f, s)
37+
commands = get_commands(project, f, s)
3838
for c in commands:
3939
all_commands += commands
4040
dedup_commands = list(set(all_commands))
4141
for c in dedup_commands:
4242
os.system(c)
4343

4444
# run formatter
45-
if FILE_MAP[language].get(FORMAT_COMMAND):
46-
print(f"\n\n$$$$ Formatting {language}:\n\n")
47-
os.system(FILE_MAP[language][FORMAT_COMMAND])
45+
if FILE_MAP[project].get(FORMAT_COMMAND):
46+
print(f"\n\n$$$$ Formatting {project}:\n\n")
47+
os.system(FILE_MAP[project][FORMAT_COMMAND])
4848

4949

5050
def check_bluehawk_installed():
@@ -55,14 +55,14 @@ def check_bluehawk_installed():
5555

5656

5757
@click.command()
58-
@click.option("--langs", default=None, help="What apps to build")
58+
@click.option("--project", default=None, help="What apps to build")
5959
@click.option(
6060
"--reader",
6161
is_flag=True,
6262
default=False,
6363
help="Whether or not to only build reader directories",
6464
)
65-
def build_apps(langs, reader):
65+
def build_apps(project, reader):
6666
"""Get commmand line arguments and build sample applications"""
6767

6868
check_bluehawk_installed()
@@ -73,19 +73,19 @@ def build_apps(langs, reader):
7373
file_map = {}
7474
build_states = []
7575

76-
if not langs:
76+
if not project:
7777
file_map = FILE_MAP
7878
else:
79-
langs_to_build = [l.strip() for l in langs.split(",")]
80-
file_map = {l: FILE_MAP[l] for l in langs_to_build}
79+
project_to_build = [l.strip() for l in project.split(",")]
80+
file_map = {l: FILE_MAP[l] for l in project_to_build}
8181

8282
if reader:
8383
build_states = [s for s in BUILD_STATES if TEST not in s]
8484
else:
8585
build_states = BUILD_STATES
8686

87-
for lang in file_map.keys():
88-
build_languages(lang, build_states)
87+
for proj in file_map.keys():
88+
build_projects(proj, build_states)
8989

9090

9191
if __name__ == "__main__":

source/includes/sample_apps/csfle/build/dotnet/aws/reader/CSFLE/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ static void Main(string[] args)
1111
InsertEncryptedDocument.Insert();
1212
}
1313
}
14-
}
14+
}

source/includes/sample_apps/csfle/build/dotnet/azure/reader/CSFLE/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ static void Main(string[] args)
1111
InsertEncryptedDocument.Insert();
1212
}
1313
}
14-
}
14+
}

source/includes/sample_apps/csfle/build/dotnet/gcp/reader/CSFLE/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ static void Main(string[] args)
1111
InsertEncryptedDocument.Insert();
1212
}
1313
}
14-
}
14+
}

source/includes/sample_apps/csfle/build/dotnet/local/reader/CSFLE/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ static void Main(string[] args)
1111
InsertEncryptedDocument.Insert();
1212
}
1313
}
14-
}
14+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
target/
2+
3+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
4+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
5+
6+
# User-specific stuff
7+
.idea/**/workspace.xml
8+
.idea/**/tasks.xml
9+
.idea/**/usage.statistics.xml
10+
.idea/**/dictionaries
11+
.idea/**/shelf
12+
13+
# AWS User-specific
14+
.idea/**/aws.xml
15+
16+
# Generated files
17+
.idea/**/contentModel.xml
18+
19+
# Sensitive or high-churn files
20+
.idea/**/dataSources/
21+
.idea/**/dataSources.ids
22+
.idea/**/dataSources.local.xml
23+
.idea/**/sqlDataSources.xml
24+
.idea/**/dynamic.xml
25+
.idea/**/uiDesigner.xml
26+
.idea/**/dbnavigator.xml
27+
28+
# Gradle
29+
.idea/**/gradle.xml
30+
.idea/**/libraries
31+
32+
# Gradle and Maven with auto-import
33+
# When using Gradle or Maven with auto-import, you should exclude module files,
34+
# since they will be recreated, and may cause churn. Uncomment if using
35+
# auto-import.
36+
# .idea/artifacts
37+
# .idea/compiler.xml
38+
# .idea/jarRepositories.xml
39+
# .idea/modules.xml
40+
# .idea/*.iml
41+
# .idea/modules
42+
# *.iml
43+
# *.ipr
44+
45+
# CMake
46+
cmake-build-*/
47+
48+
# Mongo Explorer plugin
49+
.idea/**/mongoSettings.xml
50+
51+
# File-based project format
52+
*.iws
53+
54+
# IntelliJ
55+
out/
56+
57+
# mpeltonen/sbt-idea plugin
58+
.idea_modules/
59+
60+
# JIRA plugin
61+
atlassian-ide-plugin.xml
62+
63+
# Cursive Clojure plugin
64+
.idea/replstate.xml
65+
66+
# SonarLint plugin
67+
.idea/sonarlint/
68+
69+
# Crashlytics plugin (for Android Studio and IntelliJ)
70+
com_crashlytics_export_strings.xml
71+
crashlytics.properties
72+
crashlytics-build.properties
73+
fabric.properties
74+
75+
# Editor-based Rest Client
76+
.idea/httpRequests
77+
78+
# Android studio 3.1+ serialized cache file
79+
.idea/caches/build_file_checksums.ser
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>Java-QE-guide</groupId>
4+
<artifactId>Java-QE-guide-AWS</artifactId>
5+
<version>1.0-SNAPSHOT</version>
6+
7+
<properties>
8+
<maven.compiler.source>1.8</maven.compiler.source>
9+
<maven.compiler.target>1.8</maven.compiler.target>
10+
</properties>
11+
12+
<dependencies>
13+
14+
<dependency>
15+
<groupId>org.mongodb</groupId>
16+
<artifactId>mongodb-driver-sync</artifactId>
17+
<version>4.7.0-beta0</version>
18+
</dependency>
19+
20+
<dependency>
21+
<groupId>org.mongodb</groupId>
22+
<artifactId>mongodb-crypt</artifactId>
23+
<version>1.5.0-rc1</version>
24+
</dependency>
25+
26+
</dependencies>
27+
28+
<build>
29+
<finalName>${project.artifactId}</finalName>
30+
</build>
31+
</project>

0 commit comments

Comments
 (0)