File: docker-credential-helper-registry

package info (click to toggle)
golang-github-containers-image 5.36.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,152 kB
  • sloc: sh: 267; makefile: 100
file content (27 lines) | stat: -rwxr-xr-x 709 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash

case "${1}" in
    get)
        read REGISTRY
        case "${REGISTRY}" in
            ("registry-a.com") echo "{\"ServerURL\":\"${REGISTRY}\",\"Username\":\"foo\",\"Secret\":\"bar\"}" ;;
            ("registry-b.com") echo "{\"ServerURL\":\"${REGISTRY}\",\"Username\":\"<token>\",\"Secret\":\"fizzbuzz\"}" ;;
            ("registry-no-creds.com") echo "credentials not found in native keychain" && exit 1 ;;
            (*) echo "{}" ;;
        esac
        exit 0
    ;;
    store)
        read UNUSED
        exit 0
    ;;
    list)
        read UNUSED
        echo "{\"registry-a.com\":\"foo\"}"
        exit 0
    ;;
    *)
        echo "not implemented"
        exit 1
    ;;
esac