feat: support loading oauth info from env var (#288)

Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
This commit is contained in:
Rick 2023-11-26 13:29:31 +08:00 committed by GitHub
parent 8bf774a2c9
commit 3520379db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -18,9 +18,7 @@ COPY cmd/ cmd/
COPY pkg/ pkg/
COPY extensions/ extensions/
COPY operator/ operator/
COPY .github/testing/*.yaml sample/
COPY .github/ .github/
COPY sample/ sample/
COPY docs/ docs/
COPY go.mod go.mod
COPY go.sum go.sum
@ -69,11 +67,9 @@ COPY --from=builder /workspace/atest-store-mongodb /usr/local/bin/atest-store-mo
COPY --from=builder /workspace/LICENSE /LICENSE
COPY --from=builder /workspace/README.md /README.md
COPY --from=builder /workspace/sample /var/www/sample
RUN apt update -y && \
# required for atest-store-git
apt install -y --no-install-recommends ssh-client ca-certificates && \
apt install -y curl
CMD ["atest", "server", "--local-storage=/var/www/sample/*.yaml"]
CMD ["atest", "server", "--local-storage=/var/data/atest/*.yaml"]

View File

@ -24,6 +24,8 @@ This is a API testing tool.
## Get started
[![Deployed on Zeabur](https://zeabur.com/deployed-on-zeabur-dark.svg)](https://zeabur.com?referralCode=LinuxSuRen&utm_source=LinuxSuRen&utm_campaign=oss)
Install it via [hd](https://github.com/LinuxSuRen/http-downloader) or download from [releases](https://github.com/LinuxSuRen/api-testing/releases):
```shell

View File

@ -81,13 +81,13 @@ func createServerCmd(execer fakeruntime.Execer, httpServer server.HTTPServer) (c
flags.StringVarP(&opt.configDir, "config-dir", "", os.ExpandEnv("$HOME/.config/atest"), "The config directory")
flags.StringVarP(&opt.secretServer, "secret-server", "", "", "The secret server URL")
flags.StringVarP(&opt.skyWalking, "skywalking", "", "", "Push the browser tracing data to the Apache SkyWalking HTTP URL")
flags.StringVarP(&opt.auth, "auth", "", "", "The auth mode, supported: oauth. Keep it empty to disable auth")
flags.StringVarP(&opt.auth, "auth", "", os.Getenv("AUTH_MODE"), "The auth mode, supported: oauth. Keep it empty to disable auth")
flags.StringVarP(&opt.oauthProvider, "oauth-provider", "", "github", "The oauth provider, supported: github")
flags.StringVarP(&opt.oauthServer, "oauth-server", "", "", "The oAuth server address, required if it is a private server")
flags.BoolVarP(&opt.oauthSkipTls, "oauth-skip-tls", "", false, "Skip TLS verify when connect to oauth server")
flags.StringArrayVarP(&opt.oauthGroup, "oauth-group", "", []string{}, "Alow specific groups, all groups is ok if it is empty")
flags.StringVarP(&opt.clientID, "client-id", "", "", "ClientID is the application's ID")
flags.StringVarP(&opt.clientSecret, "client-secret", "", "", "ClientSecret is the application's secret")
flags.StringVarP(&opt.clientID, "client-id", "", os.Getenv("OAUTH_CLIENT_ID"), "ClientID is the application's ID")
flags.StringVarP(&opt.clientSecret, "client-secret", "", os.Getenv("OAUTH_CLIENT_SECRET"), "ClientSecret is the application's secret")
flags.BoolVarP(&opt.dryRun, "dry-run", "", false, "Do not really start a gRPC server")
c.Flags().MarkHidden("dry-run")

View File

@ -1,4 +1,4 @@
# ATEST
# API Testing
Welcome to use `atest` to improve your code quality.
@ -32,6 +32,8 @@ Currently, it supports the following kinds of services:
* Linux and Darwin
* [Podman](https://github.com/containers/podman) and Docker
[![Deployed on Zeabur](https://zeabur.com/deployed-on-zeabur-dark.svg)](https://zeabur.com?referralCode=LinuxSuRen&utm_source=LinuxSuRen&utm_campaign=oss)
### Have a look at the following example usage:
#### Podman