-
Notifications
You must be signed in to change notification settings - Fork 42
/
plugin.go
31 lines (27 loc) · 979 Bytes
/
plugin.go
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
28
29
30
31
package aws
import (
"github.com/cyberark/secretless-broker/pkg/secretless/plugin/connector"
"github.com/cyberark/secretless-broker/pkg/secretless/plugin/connector/http"
)
// PluginInfo is required as part of the Secretless plugin spec. It provides
// important metadata about the plugin.
func PluginInfo() map[string]string {
return map[string]string{
"pluginAPIVersion": "0.1.0",
"type": "connector.http",
"id": "aws",
"description": "injects an HTTP request with AWS authorization headers",
}
}
// NewConnector returns an http.Connector that decorates each incoming http
// request with authorization data.
func NewConnector(conRes connector.Resources) http.Connector {
return &Connector{
logger: conRes.Logger(),
}
}
// GetHTTPPlugin is required as part of the Secretless plugin spec for HTTP
// connector plugins. It returns the HTTP plugin.
func GetHTTPPlugin() http.Plugin {
return http.NewConnectorFunc(NewConnector)
}