Add command to manage access to Docker configs

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-11-27 02:30:45 -05:00
parent 8d0bd7bc41
commit ac62dae890
4 changed files with 33 additions and 0 deletions

View File

@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `setting get` command to get configuration options.
- `setting list|ls` command to print configuration options.
- `--format` flag to select output format from "table", "json" or a custom Go template. Defaults to "table".
- `config access` command to set access control for configs.
- `--admins` flag to limit access to administrators.
- `--private` flag to limit access to current user.
- `--public` flag to give access to all users.
- `container access` command to set access control for containers.
- `--admins` flag to limit access to administrators.
- `--private` flag to limit access to current user.

View File

@ -1,6 +1,10 @@
FROM alpine:3.10
ENV PSU_AUTH_TOKEN=""
ENV PSU_CONFIG_ACCESS_ADMINS=""
ENV PSU_CONFIG_ACCESS_ENDPOINT=""
ENV PSU_CONFIG_ACCESS_PRIVATE=""
ENV PSU_CONFIG_ACCESS_PUBLIC=""
ENV PSU_CONTAINER_ACCESS_ADMINS=""
ENV PSU_CONTAINER_ACCESS_ENDPOINT=""
ENV PSU_CONTAINER_ACCESS_PRIVATE=""

15
cmd/config.go Normal file
View File

@ -0,0 +1,15 @@
package cmd
import (
"github.com/spf13/cobra"
)
// configCmd represents the config command
var configCmd = &cobra.Command{
Use: "config",
Short: "Manage configs",
}
func init() {
rootCmd.AddCommand(configCmd)
}

10
cmd/configAccess.go Normal file
View File

@ -0,0 +1,10 @@
package cmd
import (
"github.com/greenled/portainer-stack-utils/client"
"github.com/greenled/portainer-stack-utils/common"
)
func init() {
common.AccessCmdInitFunc(configCmd, client.ResourceConfig)
}