Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: test
run: make test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
REPO_NAME = go-plugins-helpers
REPO_OWNER = docker
PKG_NAME = github.com/${REPO_OWNER}/${REPO_NAME}
IMAGE = golang:1.16
IMAGE = golang:1.21

all: test

Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

A collection of helper packages to extend Docker Engine in Go

Plugin type | Documentation | Description
--------------|---------------|--------------------------------------------------
Authorization | [Link](https://docs.docker.com/engine/extend/authorization/) | Extend API authorization mechanism
Network | [Link](https://docs.docker.com/engine/extend/plugins_network/) | Extend network management
Volume | [Link](https://docs.docker.com/engine/extend/plugins_volume/) | Extend persistent storage
IPAM | [Link](https://github.com/docker/libnetwork/blob/master/docs/ipam.md) | Extend IP address management
Graph (experimental) | [Link](https://github.com/docker/cli/blob/master/docs/extend/plugins_graphdriver.md)| Extend image and container fs storage
| Plugin type | Documentation | Description |
|---------------|-----------------------------------------------------------------------|------------------------------------|
| Authorization | [Link](https://docs.docker.com/engine/extend/authorization/) | Extend API authorization mechanism |
| Network | [Link](https://docs.docker.com/engine/extend/plugins_network/) | Extend network management |
| Volume | [Link](https://docs.docker.com/engine/extend/plugins_volume/) | Extend persistent storage |
| IPAM | [Link](https://github.com/docker/libnetwork/blob/master/docs/ipam.md) | Extend IP address management |

See the [understand Docker plugins documentation section](https://docs.docker.com/engine/extend/plugins/).
See the [understand Docker plugins documentation section](https://docs.docker.com/engine/extend/).
20 changes: 6 additions & 14 deletions authorization/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"crypto/x509/pkix"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"math/big"
"net/http"
"os"
Expand Down Expand Up @@ -42,15 +42,13 @@ func (p *TestPlugin) AuthZRes(r Request) Response {

func TestActivate(t *testing.T) {
response, err := http.Get("http://localhost:32456/Plugin.Activate")

if err != nil {
t.Fatal(err)
}

defer response.Body.Close()

body, err := ioutil.ReadAll(response.Body)

body, err := io.ReadAll(response.Body)
if err != nil {
t.Fatal(err)
}
Expand All @@ -68,15 +66,13 @@ func TestAuthZReq(t *testing.T) {
sdk.DefaultContentTypeV1_1,
strings.NewReader(request),
)

if err != nil {
t.Fatal(err)
}

defer response.Body.Close()

body, err := ioutil.ReadAll(response.Body)

body, err := io.ReadAll(response.Body)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -107,15 +103,13 @@ func TestAuthZRes(t *testing.T) {
sdk.DefaultContentTypeV1_1,
strings.NewReader(request),
)

if err != nil {
t.Fatal(err)
}

defer response.Body.Close()

body, err := ioutil.ReadAll(response.Body)

body, err := io.ReadAll(response.Body)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -160,14 +154,14 @@ func TestPeerCertificateMarshalJSON(t *testing.T) {
publickey := &privatekey.PublicKey

// create a self-signed certificate. template = parent
var parent = template
parent := template
raw, err := x509.CreateCertificate(rand.Reader, template, parent, publickey, privatekey)
require.NoError(t, err)

cert, err := x509.ParseCertificate(raw)
require.NoError(t, err)

var certs = []*x509.Certificate{cert}
certs := []*x509.Certificate{cert}
addr := "www.authz.com/auth"
req, err := http.NewRequest("GET", addr, nil)
require.NoError(t, err)
Expand All @@ -191,11 +185,9 @@ func TestPeerCertificateMarshalJSON(t *testing.T) {
require.Nil(t, err)
require.Equal(t, "Earth", pcObj.Subject.Country[0])
require.Equal(t, true, pcObj.IsCA)

})

}

}

func callURL(url string) {
Expand Down
27 changes: 0 additions & 27 deletions graphdriver/README.md

This file was deleted.

Loading