Skip to content

Commit 99051c1

Browse files
- Shims begin.
1 parent 9306ce8 commit 99051c1

File tree

5 files changed

+47
-3
lines changed

5 files changed

+47
-3
lines changed

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
"select BackupId, BackupState from aws.cloudhsm.backups where region = 'rubbish-region' order by BackupId;",
176176
"select rings.projectsId as project, rings.locationsId as locale, split_part(rings.name, '/', -1) as key_ring_name, split_part(keys.name, '/', -1) as key_name, json_extract(keys.\"versionTemplate\", '$.algorithm') as key_algorithm, json_extract(keys.\"versionTemplate\", '$.protectionLevel') as key_protection_level from google.cloudkms.key_rings rings inner join google.cloudkms.crypto_keys keys on keys.keyRingsId = split_part(rings.name, '/', -1) and keys.projectsId = rings.projectsId and keys.locationsId = rings.locationsId where rings.projectsId in ('testing-project', 'testing-project-two', 'testing-project-three') and rings.locationsId in ('global', 'australia-southeast1', 'australia-southeast2') order by project, locale, key_name ;",
177177
"delete from aws.cloud_control.resources where region = 'ap-southeast-1' and data__TypeName = 'AWS::Logs::LogGroup' and data__Identifier = 'LogGroupResourceExampleThird' ;",
178+
"insert into google.storage.buckets( project, data__name) select 'testing-project', 'silly-bucket' returning projectNumber;",
178179
],
179180
"default": "show providers;"
180181
},

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/stackql/any-sdk v0.1.3-beta02
2323
github.com/stackql/go-suffix-map v0.0.1-alpha01
2424
github.com/stackql/psql-wire v0.1.1-beta23
25-
github.com/stackql/stackql-parser v0.0.15-alpha01
25+
github.com/stackql/stackql-parser v0.0.15-alpha05
2626
github.com/stretchr/testify v1.10.0
2727
golang.org/x/sync v0.10.0
2828
gonum.org/v1/gonum v0.11.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ github.com/stackql/readline v0.0.2-alpha05 h1:ID4QzGdplFBsrSnTuz8pvKzWw96JbrJg8f
494494
github.com/stackql/readline v0.0.2-alpha05/go.mod h1:OFAYOdXk/X4+5GYiDXFfaGrk+bCN6Qv0SYY5HNzD2E0=
495495
github.com/stackql/stackql-go-sqlite3 v1.0.3-stackql h1:j0yt6T5thZuz5+HIr81PXz2AClAtCko0vzr5tm8C1g8=
496496
github.com/stackql/stackql-go-sqlite3 v1.0.3-stackql/go.mod h1:HemqCrcMK2xyhMMMt6oZ7ERDtoSmyyDsw5LBBcTZ+Rk=
497-
github.com/stackql/stackql-parser v0.0.15-alpha01 h1:QY3W7xjIlc42BdH2ljjDlm+G6MNI756YAZ+S8nqsT/Q=
498-
github.com/stackql/stackql-parser v0.0.15-alpha01/go.mod h1:iyB47SvRS+Fvpn7joF7mHAkeiWSq83TbUhglRmLzPLQ=
497+
github.com/stackql/stackql-parser v0.0.15-alpha05 h1:VF5JnJ4N7x8aTXm7yJd+UV+UqHFz1dK+aKMhMds9Rqo=
498+
github.com/stackql/stackql-parser v0.0.15-alpha05/go.mod h1:iyB47SvRS+Fvpn7joF7mHAkeiWSq83TbUhglRmLzPLQ=
499499
github.com/stackql/stackql-provider-registry v0.0.1-rc06 h1:MgroWOr0bSqjSTDGnXB0UoZGFXpW3SRtN0EFkzB8Rpo=
500500
github.com/stackql/stackql-provider-registry v0.0.1-rc06/go.mod h1:87rVxnS2aRASK20lBQgoYA0o7FSJTZBGGRaWFR7IDm4=
501501
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

test/python/stackql_test_tooling/flask/gcp/app.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ def v1_storage_buckets_list():
1818
return render_template('buckets-list.json'), 200, {'Content-Type': 'application/json'}
1919
return '{"msg": "Project Not Found"}', 404, {'Content-Type': 'application/json'}
2020

21+
@app.route('/storage/v1/b', methods=['POST'])
22+
def v1_storage_buckets_insert():
23+
# Validate the incoming query
24+
body = request.get_json()
25+
if not body or 'name' not in body:
26+
return '{"msg": "Invalid request body"}', 400, {'Content-Type': 'application/json'}
27+
bucket_name = body['name']
28+
project_name = request.args.get('project')
29+
if not project_name:
30+
return '{"msg": "Invalid request: project not supplied"}', 400, {'Content-Type': 'application/json'}
31+
if project_name == 'testing-project':
32+
return render_template('buckets-insert-generic.jinja.json', bucket_name=bucket_name), 200, {'Content-Type': 'application/json'}
33+
return '{"msg": "Disallowed"}', 401, {'Content-Type': 'application/json'}
34+
2135
@app.route('/v1/projects/testing-project-three/locations/global/keyRings/testing-three/cryptoKeys', methods=['GET'])
2236
def v1_projects_testing_project_three_locations_global_keyRings_testing_three_cryptoKeys():
2337
return render_template('route_1_template.json'), 200, {'Content-Type': 'application/json'}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"kind": "storage#bucket",
3+
"selfLink": "https://www.googleapis.com/storage/v1/b/{{ bucket_name }}",
4+
"id": "{{ bucket_name }}",
5+
"name": "{{ bucket_name }}",
6+
"projectNumber": "100000000001",
7+
"generation": "1000000000000000001",
8+
"metageneration": "1",
9+
"location": "US",
10+
"storageClass": "STANDARD",
11+
"etag": "CAE=",
12+
"timeCreated": "2025-07-03T00:03:44.250Z",
13+
"updated": "2025-07-03T00:03:44.250Z",
14+
"softDeletePolicy": {
15+
"retentionDurationSeconds": "604800",
16+
"effectiveTime": "2025-07-03T00:03:44.250Z"
17+
},
18+
"iamConfiguration": {
19+
"bucketPolicyOnly": {
20+
"enabled": false
21+
},
22+
"uniformBucketLevelAccess": {
23+
"enabled": false
24+
},
25+
"publicAccessPrevention": "inherited"
26+
},
27+
"locationType": "multi-region",
28+
"rpo": "DEFAULT"
29+
}

0 commit comments

Comments
 (0)