https://github.com/epam/hub-dexctl
Command line tool to communicate with Dex API
https://github.com/epam/hub-dexctl
Last synced: 6 days ago
JSON representation
Command line tool to communicate with Dex API
- Host: GitHub
- URL: https://github.com/epam/hub-dexctl
- Owner: epam
- License: mpl-2.0
- Created: 2022-08-02T12:45:56.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-12T17:10:35.000Z (over 3 years ago)
- Last Synced: 2026-07-18T16:36:22.003Z (6 days ago)
- Language: Go
- Size: 38.1 KB
- Stars: 3
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dexctl
## Description
A command line tool which communicate with [The Dex API](https://dexidp.io/docs/api/). With help of this tool you could `create`, `update` and `delete` such dex entity like static password of static oauth2 clients.
### Usage
Values for global flags `host`, `port`, `ca-cert`, `client-cert` and `client-key` could be also read from env variables with prefix `DEX_API`
```bash
DEX_API_HOST="api.mydex.com" dexctl create password --email my@email.com --password verystrongpassword
```
## Development
### Prepare
```bash
go mod download
```
### Build
```bash
go build -o bin/$(go env GOOS)/dexctl \
-ldflags="-s -w \
-X 'github.com/epam/hub-dexctl/cmd.ref=$(git rev-parse --abbrev-ref HEAD)' \
-X 'github.com/epam/hub-dexctl/cmd.commit=$(git rev-parse --short HEAD)' \
-X 'github.com/epam/hub-dexctl/cmd.buildAt=$(date +"%Y.%m.%d %H:%M %Z")'"
```
### Run
```bash
./bin/$(go env GOOS)/dexctl
```
### Docker image
Docker image is based on distoless image [static-debian11](https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md)
```bash
IMAGE_NAME="ghcr.io/epam/dexctl";
IMAGE_TAG="$(git rev-parse --short HEAD)";
docker buildx build --tag "${IMAGE_NAME}:${IMAGE_TAG}" --tag "${IMAGE_NAME}:latest" . ;
```
### Contribute
Before commit and submit pull request run next commands
```bash
go fmt github.com/epam/hub-dexctl/...
go vet github.com/epam/hub-dexctl/...
```