Skip to content

Commit 8ee3d37

Browse files
Adrian Graciapetebacondarwin
authored andcommitted
SQC-480 update -uuid to -id per api changes
1 parent 8dcc50f commit 8ee3d37

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

packages/wrangler/src/__tests__/hyperdrive.test.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -628,13 +628,13 @@ describe("hyperdrive commands", () => {
628628
it("should create a hyperdrive with mtls config", async () => {
629629
const reqProm = mockHyperdriveCreate();
630630
await runWrangler(
631-
"hyperdrive create test123 --host=example.com --database=neondb --user=test --password=password --port=1234 --ca-certificate-uuid=12345 --mtls-certificate-uuid=1234"
631+
"hyperdrive create test123 --host=example.com --database=neondb --user=test --password=password --port=1234 --ca-certificate-id=12345 --mtls-certificate-id=1234"
632632
);
633633
await expect(reqProm).resolves.toMatchInlineSnapshot(`
634634
Object {
635635
"mtls": Object {
636-
"ca_certificate_uuid": "12345",
637-
"mtls_certificate_uuid": "1234",
636+
"ca_certificate_id": "12345",
637+
"mtls_certificate_id": "1234",
638638
},
639639
"name": "test123",
640640
"origin": Object {
@@ -668,15 +668,15 @@ describe("hyperdrive commands", () => {
668668
await runWrangler("hyperdrive list");
669669
expect(std.out).toMatchInlineSnapshot(`
670670
"📋 Listing Hyperdrive configs
671-
┌──────────────────────────────────────┬─────────────┬─────────┬────────────────┬──────┬────────────┬───────────┬──────────┬───────────────────────────────────────────────────────────────
672-
│ id │ name │ user │ host │ port │ scheme │ database │ caching │ mtls
673-
├──────────────────────────────────────┼─────────────┼─────────┼────────────────┼──────┼────────────┼───────────┼──────────┼───────────────────────────────────────────────────────────────
674-
│ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx │ test123 │ test │ example.com │ 5432 │ PostgreSQL │ neondb │ enabled │
675-
├──────────────────────────────────────┼─────────────┼─────────┼────────────────┼──────┼────────────┼───────────┼──────────┼───────────────────────────────────────────────────────────────
676-
│ yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy │ new-db │ dbuser │ www.google.com │ 3211 │ PostgreSQL │ mydb │ disabled │
677-
├──────────────────────────────────────┼─────────────┼─────────┼────────────────┼──────┼────────────┼───────────┼──────────┼───────────────────────────────────────────────────────────────
678-
│ zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz │ new-db-mtls │ pg-mtls │ www.mtls.com │ 3212 │ │ mydb-mtls │ enabled │ {\\"ca_certificate_uuid\\":\\"1234\\",\\"mtls_certificate_uuid\\":\\"1234\\"} │
679-
└──────────────────────────────────────┴─────────────┴─────────┴────────────────┴──────┴────────────┴───────────┴──────────┴───────────────────────────────────────────────────────────────┘"
671+
┌──────────────────────────────────────┬─────────────┬─────────┬────────────────┬──────┬────────────┬───────────┬──────────┬───────────────────────────────────────────────────────────┐
672+
│ id │ name │ user │ host │ port │ scheme │ database │ caching │ mtls │
673+
├──────────────────────────────────────┼─────────────┼─────────┼────────────────┼──────┼────────────┼───────────┼──────────┼───────────────────────────────────────────────────────────┤
674+
│ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx │ test123 │ test │ example.com │ 5432 │ PostgreSQL │ neondb │ enabled │ │
675+
├──────────────────────────────────────┼─────────────┼─────────┼────────────────┼──────┼────────────┼───────────┼──────────┼───────────────────────────────────────────────────────────┤
676+
│ yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy │ new-db │ dbuser │ www.google.com │ 3211 │ PostgreSQL │ mydb │ disabled │ │
677+
├──────────────────────────────────────┼─────────────┼─────────┼────────────────┼──────┼────────────┼───────────┼──────────┼───────────────────────────────────────────────────────────┤
678+
│ zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz │ new-db-mtls │ pg-mtls │ www.mtls.com │ 3212 │ │ mydb-mtls │ enabled │ {\\"ca_certificate_id\\":\\"1234\\",\\"mtls_certificate_id\\":\\"1234\\"} │
679+
└──────────────────────────────────────┴─────────────┴─────────┴────────────────┴──────┴────────────┴───────────┴──────────┴───────────────────────────────────────────────────────────┘"
680680
`);
681681
});
682682

@@ -985,13 +985,13 @@ describe("hyperdrive commands", () => {
985985
it("should handle updating a hyperdrive config's mtls configuration", async () => {
986986
const reqProm = mockHyperdriveUpdate();
987987
await runWrangler(
988-
"hyperdrive update xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --ca-certificate-uuid=2345 --mtls-certificate-uuid=234"
988+
"hyperdrive update xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --ca-certificate-id=2345 --mtls-certificate-id=234"
989989
);
990990
await expect(reqProm).resolves.toMatchInlineSnapshot(`
991991
Object {
992992
"mtls": Object {
993-
"ca_certificate_uuid": "2345",
994-
"mtls_certificate_uuid": "234",
993+
"ca_certificate_id": "2345",
994+
"mtls_certificate_id": "234",
995995
},
996996
}
997997
`);
@@ -1009,8 +1009,8 @@ describe("hyperdrive commands", () => {
10091009
\\"user\\": \\"test\\"
10101010
},
10111011
\\"mtls\\": {
1012-
\\"ca_certificate_uuid\\": \\"2345\\",
1013-
\\"mtls_certificate_uuid\\": \\"234\\"
1012+
\\"ca_certificate_id\\": \\"2345\\",
1013+
\\"mtls_certificate_id\\": \\"234\\"
10141014
}
10151015
}"
10161016
`);
@@ -1078,8 +1078,8 @@ function mockHyperdriveGetListOrDelete() {
10781078
scheme: "pg-mtls",
10791079
},
10801080
mtls: {
1081-
ca_certificate_uuid: "1234",
1082-
mtls_certificate_uuid: "1234",
1081+
ca_certificate_id: "1234",
1082+
mtls_certificate_id: "1234",
10831083
},
10841084
},
10851085
],
@@ -1131,8 +1131,8 @@ function mockHyperdriveUpdate(): Promise<PatchHyperdriveBody> {
11311131
}
11321132
const mtls = defaultConfig.mtls;
11331133
if (mtls && reqBody.mtls) {
1134-
mtls.ca_certificate_uuid = reqBody.mtls.ca_certificate_uuid;
1135-
mtls.mtls_certificate_uuid = reqBody.mtls.mtls_certificate_uuid;
1134+
mtls.ca_certificate_id = reqBody.mtls.ca_certificate_id;
1135+
mtls.mtls_certificate_id = reqBody.mtls.mtls_certificate_id;
11361136
}
11371137

11381138
return HttpResponse.json(

packages/wrangler/src/hyperdrive/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ export type PatchHyperdriveBody = {
8585
};
8686

8787
export type Mtls = {
88-
ca_certificate_uuid?: string;
89-
mtls_certificate_uuid?: string;
88+
ca_certificate_id?: string;
89+
mtls_certificate_id?: string;
9090
};
9191

9292
export async function createConfig(

packages/wrangler/src/hyperdrive/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ export function upsertOptions<T>(yargs: Argv<T>) {
117117
describe:
118118
"Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled",
119119
},
120-
"ca-certificate-uuid": {
120+
"ca-certificate-id": {
121121
type: "string",
122122
describe:
123123
"Sets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate.",
124124
},
125-
"mtls-certificate-uuid": {
125+
"mtls-certificate-id": {
126126
type: "string",
127127
describe:
128128
"Sets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates.",
@@ -321,8 +321,8 @@ export function getMtlsFromArgs(
321321
args: StrictYargsOptionsToInterface<typeof upsertOptions>
322322
): Mtls | undefined {
323323
const mtls = {
324-
ca_certificate_uuid: args.caCertificateUuid,
325-
mtls_certificate_uuid: args.mtlsCertificateUuid,
324+
ca_certificate_id: args.caCertificateId,
325+
mtls_certificate_id: args.mtlsCertificateId,
326326
};
327327

328328
if (JSON.stringify(mtls) === "{}") {

0 commit comments

Comments
 (0)