Skip to content

Commit

Permalink
Rename to baton-mongodb-atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreer committed Feb 28, 2024
1 parent 3f76845 commit 1c24ace
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/capabilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
go-version-file: 'go.mod'

- name: Build
run: go build -o connector ./cmd/baton-mongodb
run: go build -o connector ./cmd/baton-mongodb-atlas

- name: Run and save output
run: ./connector capabilities > baton_capabilities.json
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ jobs:
go-version: 1.22.0
- name: Checkout code
uses: actions/checkout@v3
- name: Build baton-mongodb
run: go build ./cmd/baton-mongodb
- name: Run baton-mongodb-cmd
run: ./baton-mongodb
- name: Build baton-mongodb-atlas
run: go build ./cmd/baton-mongodb-atlas
- name: Run baton-mongodb-atlas-cmd
run: ./baton-mongodb-atlas
- name: Revoke grants
if: ${{ env.REVOKE_GRANT }} != ''
run: |
echo "Syncing resources..."
./baton-mongodb
./baton-mongodb-atlas
echo "Testing revoking"
./baton-mongodb --log-level=debug --revoke-grant ${{ env.REVOKE_GRANT }}
./baton-mongodb-atlas --log-level=debug --revoke-grant ${{ env.REVOKE_GRANT }}
- name: Grant entitlements
if: ${{ env.GRANT_ENTITLEMENT }} != '' && ${{ env.GRANT_PRINCIPAL }} != '' && ${{ env.GRANT_PRINCIPAL_TYPE }} != ''
run: |
echo "Syncing resources..."
./baton-mongodb
./baton-mongodb-atlas
echo "Testing provisioning"
./baton-mongodb --log-level=debug --grant-entitlement ${{ env.GRANT_ENTITLEMENT }} --grant-principal ${{ env.GRANT_PRINCIPAL }} --grant-principal-type ${{ env.GRANT_PRINCIPAL_TYPE }}
./baton-mongodb-atlas --log-level=debug --grant-entitlement ${{ env.GRANT_ENTITLEMENT }} --grant-principal ${{ env.GRANT_PRINCIPAL }} --grant-principal-type ${{ env.GRANT_PRINCIPAL_TYPE }}
- name: List Resources
run: docker run --rm -v $(pwd):/out ghcr.io/conductorone/baton:latest -f "/out/sync.c1z" resources
6 changes: 3 additions & 3 deletions .gon-amd64.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": ["./dist/macos-amd64_darwin_amd64_v1/baton-mongodb"],
"bundle_id": "com.conductorone.baton-mongodb",
"source": ["./dist/macos-amd64_darwin_amd64_v1/baton-mongodb-atlas"],
"bundle_id": "com.conductorone.baton-mongodb-atlas",
"apple_id": {
"username" : "[email protected]",
"password": "@env:AC_PASSWORD"
Expand All @@ -9,6 +9,6 @@
"application_identity": "Developer ID Application: Justin Gallardo (858DKH55XL)"
},
"zip" :{
"output_path": "./dist/baton-mongodb-darwin-amd64.signed.zip"
"output_path": "./dist/baton-mongodb-atlas-darwin-amd64.signed.zip"
}
}
6 changes: 3 additions & 3 deletions .gon-arm64.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": ["./dist/macos-arm64_darwin_arm64/baton-mongodb"],
"bundle_id": "com.conductorone.baton-mongodb",
"source": ["./dist/macos-arm64_darwin_arm64/baton-mongodb-atlas"],
"bundle_id": "com.conductorone.baton-mongodb-atlas",
"apple_id": {
"username" : "[email protected]",
"password": "@env:AC_PASSWORD"
Expand All @@ -9,6 +9,6 @@
"application_identity": "Developer ID Application: Justin Gallardo (858DKH55XL)"
},
"zip" :{
"output_path": "./dist/baton-mongodb-darwin-arm64.signed.zip"
"output_path": "./dist/baton-mongodb-atlas-darwin-arm64.signed.zip"
}
}
34 changes: 17 additions & 17 deletions .goreleaser.docker.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
project_name: baton-mongodb
project_name: baton-mongodb-atlas
builds:
- binary: baton-mongodb
- binary: baton-mongodb-atlas
env:
- CGO_ENABLED=0
id: linux
main: ./cmd/baton-mongodb
main: ./cmd/baton-mongodb-atlas
goos:
- linux
goarch:
Expand All @@ -15,37 +15,37 @@ dockers:
goos: linux
goarch: amd64
image_templates:
- "ghcr.io/conductorone/baton-mongodb:{{ .Version }}-amd64"
- "ghcr.io/conductorone/baton-mongodb:latest-amd64"
- "ghcr.io/conductorone/baton-mongodb-atlas:{{ .Version }}-amd64"
- "ghcr.io/conductorone/baton-mongodb-atlas:latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title=baton-mongodb"
- "--label=org.opencontainers.image.title=baton-mongodb-atlas"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source=https://github.com/conductorone/baton-mongodb"
- "--label=org.opencontainers.image.source=https://github.com/conductorone/baton-mongodb-atlas"
- use: buildx
goos: linux
goarch: arm64
image_templates:
- "ghcr.io/conductorone/baton-mongodb:{{ .Version }}-arm64"
- "ghcr.io/conductorone/baton-mongodb:latest-arm64"
- "ghcr.io/conductorone/baton-mongodb-atlas:{{ .Version }}-arm64"
- "ghcr.io/conductorone/baton-mongodb-atlas:latest-arm64"
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title=baton-mongodb"
- "--label=org.opencontainers.image.title=baton-mongodb-atlas"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source=https://github.com/conductorone/baton-mongodb"
- "--label=org.opencontainers.image.source=https://github.com/conductorone/baton-mongodb-atlas"
docker_manifests:
- name_template: ghcr.io/conductorone/baton-mongodb:{{ .Version }}
- name_template: ghcr.io/conductorone/baton-mongodb-atlas:{{ .Version }}
image_templates:
- ghcr.io/conductorone/baton-mongodb:{{ .Version }}-amd64
- ghcr.io/conductorone/baton-mongodb:{{ .Version }}-arm64
- name_template: ghcr.io/conductorone/baton-mongodb:latest
- ghcr.io/conductorone/baton-mongodb-atlas:{{ .Version }}-amd64
- ghcr.io/conductorone/baton-mongodb-atlas:{{ .Version }}-arm64
- name_template: ghcr.io/conductorone/baton-mongodb-atlas:latest
image_templates:
- ghcr.io/conductorone/baton-mongodb:latest-amd64
- ghcr.io/conductorone/baton-mongodb:latest-arm64
- ghcr.io/conductorone/baton-mongodb-atlas:latest-amd64
- ghcr.io/conductorone/baton-mongodb-atlas:latest-arm64
checksum:
disable: true
release:
Expand Down
22 changes: 11 additions & 11 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
project_name: baton-mongodb
project_name: baton-mongodb-atlas
builds:
- binary: baton-mongodb
- binary: baton-mongodb-atlas
env:
- CGO_ENABLED=0
id: linux
main: ./cmd/baton-mongodb
main: ./cmd/baton-mongodb-atlas
goos:
- linux
goarch:
- amd64
- arm64
- binary: baton-mongodb
- binary: baton-mongodb-atlas
env:
- CGO_ENABLED=0
id: macos-amd64
main: ./cmd/baton-mongodb
main: ./cmd/baton-mongodb-atlas
goos:
- darwin
goarch:
- amd64
hooks:
post:
- gon .gon-amd64.json
- mv dist/baton-mongodb-darwin-amd64.signed.zip dist/macos-amd64_darwin_amd64_v1/baton-mongodb
- binary: baton-mongodb
- mv dist/baton-mongodb-atlas-darwin-amd64.signed.zip dist/macos-amd64_darwin_amd64_v1/baton-mongodb-atlas
- binary: baton-mongodb-atlas
env:
- CGO_ENABLED=0
id: macos-arm64
main: ./cmd/baton-mongodb
main: ./cmd/baton-mongodb-atlas
goos:
- darwin
goarch:
- arm64
hooks:
post:
- gon .gon-arm64.json
- mv dist/baton-mongodb-darwin-arm64.signed.zip dist/macos-arm64_darwin_arm64/baton-mongodb
- mv dist/baton-mongodb-atlas-darwin-arm64.signed.zip dist/macos-arm64_darwin_arm64/baton-mongodb-atlas
archives:
- id: linux-archive
builds:
Expand Down Expand Up @@ -71,9 +71,9 @@ brews:
folder: Formula
homepage: https://conductorone.com
test: |
system "#{bin}/baton-mongodb -v"
system "#{bin}/baton-mongodb-atlas -v"
install: |-
bin.install "baton-mongodb"
bin.install "baton-mongodb-atlas"
changelog:
filters:
exclude:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM gcr.io/distroless/static-debian11:nonroot
ENTRYPOINT ["/baton-mongodb"]
COPY baton-mongodb /
ENTRYPOINT ["/baton-mongodb-atlas"]
COPY baton-mongodb-atlas /
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ GOARCH = $(shell go env GOARCH)
BUILD_DIR = dist/${GOOS}_${GOARCH}

ifeq ($(GOOS),windows)
OUTPUT_PATH = ${BUILD_DIR}/baton-mongodb.exe
OUTPUT_PATH = ${BUILD_DIR}/baton-mongodb-atlas.exe
else
OUTPUT_PATH = ${BUILD_DIR}/baton-mongodb
OUTPUT_PATH = ${BUILD_DIR}/baton-mongodb-atlas
endif

.PHONY: build
build:
go build -o ${OUTPUT_PATH} ./cmd/baton-mongodb
go build -o ${OUTPUT_PATH} ./cmd/baton-mongodb-atlas

.PHONY: update-deps
update-deps:
Expand Down
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baton-mongodb
Copyright 2023 ConductorOne, Inc.
baton-mongodb-atlas
Copyright 2024 ConductorOne, Inc.

This product includes software developed by ConductorOne (https://www.conductorone.com/).
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
![Baton Logo](./docs/images/baton-logo.png)

# `baton-mongodb` [![Go Reference](https://pkg.go.dev/badge/github.com/conductorone/baton-mongodb.svg)](https://pkg.go.dev/github.com/conductorone/baton-mongodb) ![main ci](https://github.com/conductorone/baton-mongodb/actions/workflows/main.yaml/badge.svg)
# `baton-mongodb-atlas` [![Go Reference](https://pkg.go.dev/badge/github.com/conductorone/baton-mongodb-atlas.svg)](https://pkg.go.dev/github.com/conductorone/baton-mongodb-atlas) ![main ci](https://github.com/conductorone/baton-mongodb-atlas/actions/workflows/main.yaml/badge.svg)

`baton-mongodb` is a connector for Baton built using the [Baton SDK](https://github.com/conductorone/baton-sdk). It works with MongoDB Atlas API.
`baton-mongodb-atlas` is a connector for Baton built using the [Baton SDK](https://github.com/conductorone/baton-sdk). It works with MongoDB Atlas API.

Check out [Baton](https://github.com/conductorone/baton) to learn more about the project in general.

Expand All @@ -17,30 +17,30 @@ After you have obtained both private and public key, you can use it with connect
## brew

```
brew install conductorone/baton/baton conductorone/baton/baton-mongodb
BATON_PUBLIC_KEY=key BATON_PRIVATE_KEY=private-key baton-mongodb
brew install conductorone/baton/baton conductorone/baton/baton-mongodb-atlas
BATON_PUBLIC_KEY=key BATON_PRIVATE_KEY=private-key baton-mongodb-atlas
baton resources
```

## docker

```
docker run --rm -v $(pwd):/out -e BATON_PUBLIC_KEY=key BATON_PRIVATE_KEY=private-key ghcr.io/conductorone/baton-mongodb:latest -f "/out/sync.c1z"
docker run --rm -v $(pwd):/out -e BATON_PUBLIC_KEY=key BATON_PRIVATE_KEY=private-key ghcr.io/conductorone/baton-mongodb-atlas:latest -f "/out/sync.c1z"
docker run --rm -v $(pwd):/out ghcr.io/conductorone/baton:latest -f "/out/sync.c1z" resources
```

## source

```
go install github.com/conductorone/baton/cmd/baton@main
go install github.com/conductorone/baton-mongodb/cmd/baton-mongodb@main
BATON_PUBLIC_KEY=key BATON_PRIVATE_KEY=private-key baton-mongodb
go install github.com/conductorone/baton-mongodb-atlas/cmd/baton-mongodb-atlas@main
BATON_PUBLIC_KEY=key BATON_PRIVATE_KEY=private-key baton-mongodb-atlas
baton resources
```

# Data Model

`baton-mongodb` will fetch information about the following Baton resources:
`baton-mongodb-atlas` will fetch information about the following Baton resources:

- Users
- Database Users
Expand All @@ -55,14 +55,14 @@ We started Baton because we were tired of taking screenshots and manually buildi

See [CONTRIBUTING.md](https://github.com/ConductorOne/baton/blob/main/CONTRIBUTING.md) for more details.

# `baton-mongodb` Command Line Usage
# `baton-mongodb-atlas` Command Line Usage

```
baton-mongodb
baton-mongodb-atlas
Usage:
baton-mongodb [flags]
baton-mongodb [command]
baton-mongodb-atlas [flags]
baton-mongodb-atlas [command]
Available Commands:
capabilities Get connector capabilities
Expand All @@ -73,13 +73,13 @@ Flags:
--client-id string The client ID used to authenticate with ConductorOne ($BATON_CLIENT_ID)
--client-secret string The client secret used to authenticate with ConductorOne ($BATON_CLIENT_SECRET)
-f, --file string The path to the c1z file to sync with ($BATON_FILE) (default "sync.c1z")
-h, --help help for baton-mongodb
-h, --help help for baton-mongodb-atlas
--log-format string The output format for logs: json, console ($BATON_LOG_FORMAT) (default "json")
--log-level string The log level: debug, info, warn, error ($BATON_LOG_LEVEL) (default "info")
--private-key string Private Key
-p, --provisioning This must be set in order for provisioning actions to be enabled. ($BATON_PROVISIONING)
--public-key string Public Key
-v, --version version for baton-mongodb
-v, --version version for baton-mongodb-atlas
Use "baton-mongodb [command] --help" for more information about a command.
Use "baton-mongodb-atlas [command] --help" for more information about a command.
```
File renamed without changes.
4 changes: 2 additions & 2 deletions cmd/baton-mongodb/main.go → cmd/baton-mongodb-atlas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
"go.uber.org/zap"

"github.com/conductorone/baton-mongodb/pkg/connector"
"github.com/conductorone/baton-mongodb-atlas/pkg/connector"
)

var version = "dev"
Expand All @@ -20,7 +20,7 @@ func main() {
ctx := context.Background()

cfg := &config{}
cmd, err := cli.NewCmd(ctx, "baton-mongodb", cfg, validateConfig, getConnector)
cmd, err := cli.NewCmd(ctx, "baton-mongodb-atlas", cfg, validateConfig, getConnector)
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/conductorone/baton-mongodb
module github.com/conductorone/baton-mongodb-atlas

go 1.20

Expand Down

0 comments on commit 1c24ace

Please sign in to comment.