1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 06:19:41 +02:00
portainer/app/react/docker/images/queries/encodeRegistryCredentials.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
372 B
TypeScript
Raw Normal View History

import { Registry } from '@/react/portainer/registries/types/registry';
/**
* Encodes the registry credentials in base64
* @param registryId
* @returns
*/
export function encodeRegistryCredentials(registryId: Registry['Id']) {
const credentials = {
registryId,
};
const buf = Buffer.from(JSON.stringify(credentials));
return buf.toString('base64url');
}