Skip to content

Commit f6ccc10

Browse files
fix(sdk): Fix for queries to older platforms (#570)
* Use the gRPC gateway variant for now; we will switch to connectRPC with a feature flag later
1 parent 5afd0d0 commit f6ccc10

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

lib/src/access.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,11 @@ export async function fetchKeyAccessServers(
164164
const allServers = [];
165165
do {
166166
const req = await authProvider.withCreds({
167-
url: `${platformUrl}/policy.kasregistry.KeyAccessServerRegistryService/ListKeyAccessServers`,
168-
method: 'POST',
167+
url: `${platformUrl}/key-access-servers?pagination.offset=${nextOffset}`,
168+
method: 'GET',
169169
headers: {
170170
'Content-Type': 'application/json',
171171
},
172-
body: JSON.stringify({
173-
pagination: {
174-
offset: nextOffset,
175-
},
176-
}),
177172
});
178173
let response: Response;
179174
try {

lib/tests/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ const kas: RequestListener = async (req, res) => {
374374
res.statusCode = 200;
375375
res.end('Server stopped');
376376
} else if (
377-
url.pathname === '/policy.kasregistry.KeyAccessServerRegistryService/ListKeyAccessServers'
377+
url.pathname === '/policy.kasregistry.KeyAccessServerRegistryService/ListKeyAccessServers' ||
378+
url.pathname === '/key-access-servers'
378379
) {
379380
console.log('Listed Key Access Servers!');
380381
res.writeHead(200);

0 commit comments

Comments
 (0)