Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token header name "X-Casssandra-Token" -> "Token" #607

Merged
merged 12 commits into from
Nov 2, 2023
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,5 @@ The extension setups the health endpoints under `/stargate/health`.

The OpenAPI definitions are generated and available under `/api/json/openapi` endpoint.
The [StargateJsonApi](src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java) class defines the `@OpenAPIDefinition` annotation.
This definition defines the default *SecurityScheme* named `Token`, which expects the header based authentication with the HTTP Header `X-Cassandra-Token`.
This definition defines the default *SecurityScheme* named `Token`, which expects the header based authentication with the HTTP Header `Token`.
The `info` portions of the Open API definitions are set using the `quarkus.smallrye-openapi.info-` configuration properties.
2 changes: 1 addition & 1 deletion docs/jsonapi-network-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ The HTTP API provides two types of endpoints:
Both endpoints follow these rules:

1. All requests **must** use a HTTP `POST` verb.
2. Requests **must** supply a `Cassandra-Token` header **TODO:** Why
2. Requests **must** supply a `Token` header **TODO:** Why
not just Authorization, current rest API is X-Cassandra-Token, using
X is deprecated
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
Expand Down
24 changes: 12 additions & 12 deletions fallout/dataset-test-nosqlbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
body: >2
Expand All @@ -72,7 +72,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
body: >2
Expand All @@ -87,7 +87,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
body: >2
Expand All @@ -105,7 +105,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: '.*\"insertedIds\":\[.*\].*'
body: >2
Expand All @@ -129,7 +129,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -148,7 +148,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -167,7 +167,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -186,7 +186,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -209,7 +209,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -232,7 +232,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
# because this is not an upsert, modified count could technically be 0 or 1,
# but since we are fixing the _ids to be sequential over the docscount range during the write phase,
Expand All @@ -259,7 +259,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"deletedCount\":[0,1].*"
body: >2
Expand All @@ -278,7 +278,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_dataset_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand Down
28 changes: 14 additions & 14 deletions fallout/smoke-test-nosqlbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
body: >2
Expand All @@ -69,7 +69,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
body: >2
Expand All @@ -84,7 +84,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
body: >2
Expand All @@ -103,7 +103,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: '.*\"insertedIds\":\[.*\].*'
body: >2
Expand Down Expand Up @@ -146,7 +146,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -165,7 +165,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -184,7 +184,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -204,7 +204,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -230,7 +230,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -252,7 +252,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand Down Expand Up @@ -280,7 +280,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"deletedCount\":[0,1].*"
body: >2
Expand All @@ -299,7 +299,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand Down Expand Up @@ -344,7 +344,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"status\".*"
body: >2
Expand All @@ -371,7 +371,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_smoke_test>>/<<collection:docs_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"count\".*"
body: >2
Expand Down
6 changes: 3 additions & 3 deletions fallout/vector-insertmany-nosqlbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_insertmany_namespace>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
body: >2
Expand All @@ -59,7 +59,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_insertmany_namespace>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
# vector mush be enabled when creating collection
Expand All @@ -84,7 +84,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_insertmany_namespace>>/<<collection:jsonapi_vector_insertmany_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: '.*\"insertedIds\":\[.*\].*'
body: >2
Expand Down
14 changes: 7 additions & 7 deletions fallout/vector-test-nosqlbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_crud_namespace>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
body: >2
Expand All @@ -61,7 +61,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_crud_namespace>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"ok\":1.*"
# vector mush be enabled when creating collection
Expand All @@ -86,7 +86,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_crud_namespace>>/<<collection:jsonapi_vector_crud_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: '.*\"insertedIds\":\[.*\].*'
body: >2
Expand All @@ -106,7 +106,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_crud_namespace>>/<<collection:jsonapi_vector_crud_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -122,7 +122,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_crud_namespace>>/<<collection:jsonapi_vector_crud_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -143,7 +143,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_crud_namespace>>/<<collection:jsonapi_vector_crud_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"data\".*"
body: >2
Expand All @@ -162,7 +162,7 @@ blocks:
uri: <<protocol:http>>://{weighted_hosts}:<<jsonapi_port:8181>><<path_prefix:>>/v1/<<namespace:jsonapi_vector_crud_namespace>>/<<collection:jsonapi_vector_crud_collection>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "{token}"
Token: "{token}"
Content-Type: "application/json"
ok-body: ".*\"deletedCount\":[0,1].*"
body: >2
Expand Down
Loading