Skip to content

Commit

Permalink
fix: add redhat registry logo (#64)
Browse files Browse the repository at this point in the history
* fix: add redhat registry logo

Signed-off-by: Denis Golovin <[email protected]>

* Update registry name to 'Red Hat Container Registry'

Co-authored-by: Florent BENOIT <[email protected]>

---------

Signed-off-by: Denis Golovin <[email protected]>
Co-authored-by: Florent BENOIT <[email protected]>
  • Loading branch information
dgolovin and benoitf authored Mar 1, 2024
1 parent 912ebce commit 597b2d9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ async function getAuthService() {
return authService;
}

// function to encode file data to base64 encoded string
function fileToBase64(file: string) {
// read binary data
var bitmap = readFileSync(file);
// convert binary data to base64 encoded string
return new Buffer(bitmap).toString('base64');
}

function parseJwt (token: string) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
Expand All @@ -75,7 +83,9 @@ async function createRegistry(username: string, secret: string, serverUrl: strin
serverUrl,
username,
secret,
source: ''
source: '',
name: 'Red Hat Container Registry',
icon: fileToBase64(path.resolve(__dirname,'..', 'icon.png')),
});
}

Expand Down

0 comments on commit 597b2d9

Please sign in to comment.