Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Setup system dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq

- name: Setup Python
uses: actions/setup-python@v5.0.0
with:
Expand Down Expand Up @@ -137,8 +142,6 @@ jobs:
- name: Trivial CLI Test
if: success()
run: |
sudo apt-get update
sudo apt-get install -y jq
result="$(build/anysdk const | jq -r '.ExtensionKeyAlwaysRequired')"
if [ "$result" != "x-alwaysRequired" ]; then
echo "Trivial CLI Test Failed with unexpected result: $result"
Expand Down Expand Up @@ -189,6 +192,46 @@ jobs:
else
echo "Core Test passed with matching buckets: $matchingBuckets"
fi

- name: Run local templated openssl mutate test
run: |
rm -rf test/tmp/*.pem
${{ github.workspace }}/build/anysdk query \
--svc-file-path="test/registry/src/local_openssl/v0.1.0/services/keys.yaml" \
--prov-file-path="test/registry/src/local_openssl/v0.1.0/provider.yaml" \
--resource rsa \
--method create_key_pair \
--parameters '{
"config_file": "test/openssl/openssl.cnf",
"key_out_file": "test/tmp/key.pem",
"cert_out_file": "test/tmp/cert.pem",
"days": 90
}'
endDateFound="$(openssl x509 -in test/tmp/cert.pem -noout -dates | grep "notAfter")"
if [ "${endDateFound}" = "" ]; then
echo "Core Test Failed with no matching end date"
exit 1
else
echo "Core Test passed with matching end date info: $endDateFound"
fi

- name: Run local templated openssl select test
run: |
response="$(${{ github.workspace }}/build/anysdk query \
--svc-file-path='test/registry/src/local_openssl/v0.1.0/services/keys.yaml' \
--prov-file-path='test/registry/src/local_openssl/v0.1.0/provider.yaml' \
--resource x509 \
--method describe_certificate \
--parameters '{
"cert_file": "test/tmp/cert.pem"
}')"
publicKeyAlgorithm="$(echo "$response" | jq -r '.public_key_algorithm')"
if [ "${publicKeyAlgorithm}" != "rsaEncryption" ]; then
echo "Core Test Failed with unexpected public key algorithm '$publicKeyAlgorithm'"
exit 1
else
echo "Core Test passed with matching public key algorithm: '$publicKeyAlgorithm'"
fi

macosbuild:
name: MacOS Build
Expand Down
1 change: 1 addition & 0 deletions .vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
54 changes: 54 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "go",
"request": "launch",
"name": "Run standalone file",
"mode": "auto",
"program": "${file}",
"envFile": "${workspaceFolder}/.vscode/.env",
},
{
"type": "go",
"request": "launch",
"name": "CLI local: rsa openssl create",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interrogate",
"envFile": "${workspaceFolder}/.vscode/.env",
"args": [
"query",
"--svc-file-path=${workspaceFolder}/test/registry/src/local_openssl/v0.1.0/services/keys.yaml",
"--prov-file-path=${workspaceFolder}/test/registry/src/local_openssl/v0.1.0/provider.yaml",
"--resource",
"rsa",
"--method",
"create_key_pair",
"--parameters",
"{ \"config_file\": \"${workspaceFolder}/test/openssl/openssl.cnf\", \"key_out_file\": \"${workspaceFolder}/test/tmp/key.pem\", \"cert_out_file\": \"${workspaceFolder}/test/tmp/cert.pem\", \"days\": 90}"
]
},
{
"type": "go",
"request": "launch",
"name": "CLI local: x509 openssl describe",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interrogate",
"envFile": "${workspaceFolder}/.vscode/.env",
"args": [
"query",
"--svc-file-path=${workspaceFolder}/test/registry/src/local_openssl/v0.1.0/services/keys.yaml",
"--prov-file-path=${workspaceFolder}/test/registry/src/local_openssl/v0.1.0/provider.yaml",
"--resource",
"x509",
"--method",
"describe_certificate",
"--parameters",
"{ \"cert_file\": \"${workspaceFolder}/test/tmp/cert.pem\"}"
]
}
]
}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ A golang library to support:

From those who brought you

[![StackQL](https://stackql.io/img/stackql-banner.png)](https://stackql.io/)
[![StackQL](https://stackql.io/img/stackql-banner.png)](https://stackql.io/)

## Evolution to protocol agnostic

The basic idea is a full decouple and abstraction of the interface from openapi.

Based upon the fact that [golang text templates are Turing complete](https://linuxtut.com/en/2072207ec0565a80d2b2/), as are numerous other DSLs, we can use these to define and route SQL input to arbitrary interfaces. For instance, here is [the brainf@$& interpreter](https://github.com/Syuparn/go-template-bf-interpreter/blob/1b7f6a3720295c93ffa99b58a81f153bd8d7ecc8/bf-interpreter.tpl) described in the article.

As a side note, [this review piece](https://solutionspace.blog/2021/12/04/every-simple-language-will-eventually-end-up-turing-complete/) gives some insight into whay all DSLs wind up Turing complete and also therefore rather messy for narrowband purposes.

## Acknowledgements

Expand Down
Loading