Skip to content
Open
Show file tree
Hide file tree
Changes from 16 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
5 changes: 5 additions & 0 deletions .changeset/five-hoops-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-hive/cli': minor
---

Improve output of the `hive whoami` command. It now also handles the new access token format.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a change for hive also for the token scoping.

11 changes: 10 additions & 1 deletion integration-tests/testkit/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import {
import { execute } from './graphql';
import { UpdateSchemaPolicyForOrganization, UpdateSchemaPolicyForProject } from './schema-policy';
import { collect, CollectedOperation, legacyCollect } from './usage';
import { generateUnique } from './utils';
import { generateUnique, getServiceHost } from './utils';

export function initSeed() {
function createConnectionPool() {
Expand Down Expand Up @@ -89,6 +89,15 @@ export function initSeed() {
},
authenticate,
generateEmail: () => userEmail(generateUnique()),
async purgeOrganizationAccessTokenById(id: string) {
const registryAddress = await getServiceHost('server', 8082);
await fetch(
'http://' + registryAddress + '/cache/organization-access-token-cache/delete/' + id,
{
method: 'POST',
},
).then(res => res.json());
},
async createOwner() {
const ownerEmail = userEmail(generateUnique());
const auth = await authenticate(ownerEmail);
Expand Down
9 changes: 9 additions & 0 deletions integration-tests/testkit/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,12 @@ export function assertNonNull<T>(
throw new Error(message);
}
}

export function assertNonNullish<T>(
value: T | null | undefined,
message = 'Expected non-null value.',
): asserts value is T {
if (value === null) {
throw new Error(message);
}
}
Loading
Loading