Skip to content

Commit

Permalink
Merge pull request #3 from ConductorOne/mchavez-mongodb
Browse files Browse the repository at this point in the history
Adding POC
  • Loading branch information
ggreer authored Feb 28, 2024
2 parents b9c8ef8 + 7680332 commit 0f709d5
Show file tree
Hide file tree
Showing 967 changed files with 62,806 additions and 40,702 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
go-test:
strategy:
matrix:
go-version: [1.20.x]
go-version: [1.22.0]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
go-test:
strategy:
matrix:
go-version: [ 1.20.x ]
go-version: [ 1.22.0 ]
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.22.0
- name: Docker Login
uses: docker/login-action@v1
with:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: tests
on:
workflow_dispatch:
push:
jobs:
test:
runs-on: ubuntu-latest
env:
BATON_PUBLIC_KEY: ${{ secrets.BATON_PUBLIC_KEY }}
BATON_PRIVATE_KEY: ${{ secrets.BATON_PRIVATE_KEY }}
BATON_LOG_LEVEL: 'debug'
# Revoke grants variable
REVOKE_GRANT: 'team:65de391acee49637479ff761:member:user:6000932cdb25974d816dd711'
# Grant entitlements variables
GRANT_ENTITLEMENT: 'team:65de391acee49637479ff761:member'
GRANT_PRINCIPAL: '6000932cdb25974d816dd711'
GRANT_PRINCIPAL_TYPE: 'user'

steps:
- name: Install Go
uses: actions/setup-go@v4
with:
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: Revoke grants
if: ${{ env.REVOKE_GRANT }} != ''
run: |
echo "Syncing resources..."
./baton-mongodb
echo "Testing revoking"
./baton-mongodb --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
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 }}
- name: List Resources
run: docker run --rm -v $(pwd):/out ghcr.io/conductorone/baton:latest -f "/out/sync.c1z" resources
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Baton Logo](./docs/images/baton-logo.png)
![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)

Expand Down Expand Up @@ -82,4 +82,4 @@ Flags:
-v, --version version for baton-mongodb
Use "baton-mongodb [command] --help" for more information about a command.
```
```
73 changes: 37 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,49 @@ module github.com/conductorone/baton-mongodb
go 1.20

require (
github.com/conductorone/baton-sdk v0.1.8
github.com/conductorone/baton-sdk v0.1.26
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/spf13/cobra v1.8.0
go.mongodb.org/atlas-sdk/v20231001002 v20231001002.0.0
go.uber.org/zap v1.26.0
)

require (
github.com/aws/aws-sdk-go-v2 v1.21.2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14 // indirect
github.com/aws/aws-sdk-go-v2/config v1.19.1 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.43 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.92 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect
github.com/aws/smithy-go v1.15.0 // indirect
filippo.io/age v1.1.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.23.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.25.3 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.16.2 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.14.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.43.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.17.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.25.3 // indirect
github.com/aws/smithy-go v1.17.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/doug-martin/goqu/v9 v9.18.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/klauspost/compress v1.17.3 // indirect
github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand All @@ -54,39 +58,36 @@ require (
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/shirou/gopsutil/v3 v3.23.9 // indirect
github.com/shirou/gopsutil/v3 v3.23.10 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.17.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.mongodb.org/atlas-sdk/v20231001002 v20231001002.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/ratelimit v0.3.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/oauth2 v0.14.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.29.0 // indirect
modernc.org/libc v1.34.7 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/sqlite v1.26.0 // indirect
modernc.org/sqlite v1.27.0 // indirect
)
Loading

0 comments on commit 0f709d5

Please sign in to comment.