-
Notifications
You must be signed in to change notification settings - Fork 0
[BB-1829] business plus support #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ba778af
add support for business plus, fix actions
aldevv 61c81d2
remove dead code
aldevv a9287de
remove dead resource types
aldevv 832aebf
update ci, remove more dead code
aldevv c9759dd
add business plus
aldevv a9712c7
refactor wraperrors
aldevv 9d838fe
refactor ci
aldevv 8fe7253
fix lint
aldevv fc9aac2
Merge branch 'main' into business_plus_and_actions_fix
aldevv 4c737f2
update ci
aldevv 5d8f7d3
Merge branch 'business_plus_and_actions_fix' of github.com:ConductorO…
aldevv 8382115
fix ci code
aldevv 531a523
remove dead code
aldevv c5c1976
handle rate limit
aldevv d82caf6
update wraperrors
aldevv 3db22a7
fix repeated user_id
aldevv a555432
fix log body
aldevv a3d8409
remove useless logBody
aldevv 855c277
remove ssoenabled
aldevv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,256 +35,24 @@ jobs: | |
| uses: guyarb/[email protected] | ||
| with: | ||
| test-results: test.json | ||
| test-member: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| BATON_LOG_LEVEL: debug | ||
|
|
||
| CONNECTOR_GRANT: 'workspaceRole:T08101AQL31:member:assigned:user:U083SJ36LCD' | ||
| CONNECTOR_ENTITLEMENT: 'workspaceRole:T08101AQL31:member:assigned' | ||
| CONNECTOR_PRINCIPAL: 'U083SJ36LCD' | ||
| CONNECTOR_PRINCIPAL_TYPE: 'user' | ||
|
|
||
| BATON_TOKEN: "${{ secrets.BATON_TOKEN }}" | ||
| BATON_ENTERPRISE_TOKEN: "${{ secrets.BATON_ENTERPRISE_TOKEN }}" | ||
|
|
||
| BATON_TOKEN: ${{ secrets.BATON_TOKEN }} | ||
| BATON_BUSINESS_PLUS_TOKEN: ${{ secrets.BATON_BUSINESS_PLUS_TOKEN }} | ||
| steps: | ||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.25.x | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Build baton-slack | ||
| run: go build ./cmd/baton-slack | ||
| - name: Run baton-slack | ||
| run: ./baton-slack | ||
| - name: Install baton | ||
| run: ./scripts/get-baton.sh && mv baton /usr/local/bin | ||
|
|
||
| - name: Grant entitlement first time | ||
| run: | | ||
| ./baton-slack --grant-entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" \ | ||
| --grant-principal="${{ env.CONNECTOR_PRINCIPAL }}" \ | ||
| --grant-principal-type="${{ env.CONNECTOR_PRINCIPAL_TYPE }}" | ||
|
|
||
| - name: Check for grant before revoking | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status ".grants[].principal.id.resource == \"${{ env.CONNECTOR_PRINCIPAL }}\"" | grep true | ||
|
|
||
| - name: Revoke grants | ||
| run: ./baton-slack --revoke-grant="${{ env.CONNECTOR_GRANT }}" | ||
|
|
||
| - name: Check grant was revoked | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status "if .grants then .grants[]?.principal.id.resource != \"${{ env.CONNECTOR_PRINCIPAL }}\" else . end" | ||
|
|
||
| - name: Grant entitlement second time | ||
| run: | | ||
| ./baton-slack --grant-entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" \ | ||
| --grant-principal="${{ env.CONNECTOR_PRINCIPAL }}" \ | ||
| --grant-principal-type="${{ env.CONNECTOR_PRINCIPAL_TYPE }}" | ||
|
|
||
| - name: Wait 10 seconds | ||
| run: sleep 10 | ||
|
|
||
| - name: Check grant was re-granted | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status ".grants[].principal.id.resource == \"${{ env.CONNECTOR_PRINCIPAL }}\"" | grep true | ||
|
|
||
| test-admin: | ||
| needs: [test-member] | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| # Logging level for Baton | ||
| BATON_LOG_LEVEL: debug | ||
|
|
||
| # Connector-specific details | ||
| CONNECTOR_GRANT: 'workspaceRole:T08101AQL31:admin:assigned:user:U083SJ36LCD' | ||
| CONNECTOR_ENTITLEMENT: 'workspaceRole:T08101AQL31:admin:assigned' | ||
| CONNECTOR_PRINCIPAL: 'U083SJ36LCD' | ||
| CONNECTOR_PRINCIPAL_TYPE: 'user' | ||
|
|
||
| # Secrets for Baton authentication | ||
| BATON_TOKEN: "${{ secrets.BATON_TOKEN }}" | ||
| BATON_ENTERPRISE_TOKEN: "${{ secrets.BATON_ENTERPRISE_TOKEN }}" | ||
|
|
||
| steps: | ||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.25.x | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| go-version-file: go.mod | ||
| - name: Build baton-slack | ||
| run: go build ./cmd/baton-slack | ||
|
|
||
| - name: Run baton-slack | ||
| run: ./baton-slack | ||
| - name: Install baton | ||
| run: ./scripts/get-baton.sh && mv baton /usr/local/bin | ||
|
|
||
| - name: Grant entitlement first time | ||
| run: | | ||
| ./baton-slack --grant-entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" \ | ||
| --grant-principal="${{ env.CONNECTOR_PRINCIPAL }}" \ | ||
| --grant-principal-type="${{ env.CONNECTOR_PRINCIPAL_TYPE }}" | ||
|
|
||
| - name: Check for grant before revoking | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status ".grants[].principal.id.resource == \"${{ env.CONNECTOR_PRINCIPAL }}\"" | grep true | ||
|
|
||
| - name: Revoke grants | ||
| run: ./baton-slack --revoke-grant="${{ env.CONNECTOR_GRANT }}" | ||
|
|
||
| - name: Check grant was revoked | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status "if .grants then .grants[]?.principal.id.resource != \"${{ env.CONNECTOR_PRINCIPAL }}\" else . end" | ||
| # | ||
| - name: Grant entitlement second time | ||
| run: | | ||
| ./baton-slack --grant-entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" \ | ||
| --grant-principal="${{ env.CONNECTOR_PRINCIPAL }}" \ | ||
| --grant-principal-type="${{ env.CONNECTOR_PRINCIPAL_TYPE }}" | ||
|
|
||
| - name: Check grant was re-granted | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status ".grants[].principal.id.resource == \"${{ env.CONNECTOR_PRINCIPAL }}\"" | grep true | ||
|
|
||
|
|
||
| test-owner: | ||
| needs: [test-member, test-admin] | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| BATON_LOG_LEVEL: debug | ||
|
|
||
| CONNECTOR_GRANT: 'workspaceRole:T08101AQL31:owner:assigned:user:U083SJ36LCD' | ||
| CONNECTOR_ENTITLEMENT: 'workspaceRole:T08101AQL31:owner:assigned' | ||
| CONNECTOR_PRINCIPAL: 'U083SJ36LCD' | ||
| CONNECTOR_PRINCIPAL_TYPE: 'user' | ||
|
|
||
| BATON_TOKEN: "${{ secrets.BATON_TOKEN }}" | ||
| BATON_ENTERPRISE_TOKEN: "${{ secrets.BATON_ENTERPRISE_TOKEN }}" | ||
|
|
||
| steps: | ||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| - name: Grant/revoke | ||
| uses: ConductorOne/github-workflows/actions/sync-test@v2 | ||
| with: | ||
| go-version: 1.25.x | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Build baton-slack | ||
| run: go build ./cmd/baton-slack | ||
|
|
||
| - name: Run baton-slack | ||
| run: ./baton-slack | ||
| - name: Install baton | ||
| run: ./scripts/get-baton.sh && mv baton /usr/local/bin | ||
|
|
||
| - name: Grant entitlement first time | ||
| run: | | ||
| ./baton-slack --grant-entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" \ | ||
| --grant-principal="${{ env.CONNECTOR_PRINCIPAL }}" \ | ||
| --grant-principal-type="${{ env.CONNECTOR_PRINCIPAL_TYPE }}" | ||
|
|
||
| - name: Check for grant before revoking | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status ".grants[].principal.id.resource == \"${{ env.CONNECTOR_PRINCIPAL }}\"" | grep true | ||
|
|
||
| - name: Revoke grants | ||
| run: ./baton-slack --revoke-grant="${{ env.CONNECTOR_GRANT }}" | ||
|
|
||
| - name: Check grant was revoked | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status "if .grants then .grants[]?.principal.id.resource != \"${{ env.CONNECTOR_PRINCIPAL }}\" else . end" | ||
|
|
||
| - name: Grant entitlement second time | ||
| run: | | ||
| ./baton-slack --grant-entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" \ | ||
| --grant-principal="${{ env.CONNECTOR_PRINCIPAL }}" \ | ||
| --grant-principal-type="${{ env.CONNECTOR_PRINCIPAL_TYPE }}" | ||
|
|
||
| - name: Check grant was re-granted | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status ".grants[].principal.id.resource == \"${{ env.CONNECTOR_PRINCIPAL }}\"" | grep -q "true" | ||
|
|
||
| test-enterprise-roles: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| BATON_LOG_LEVEL: debug | ||
|
|
||
| CONNECTOR_GRANT: 'enterpriseRole:Rl0K:assigned:user:U083SJ36LCD' | ||
| CONNECTOR_ENTITLEMENT: 'enterpriseRole:Rl0K:assigned' | ||
| CONNECTOR_PRINCIPAL: 'U083SJ36LCD' | ||
| CONNECTOR_PRINCIPAL_TYPE: 'user' | ||
|
|
||
| BATON_TOKEN: "${{ secrets.BATON_TOKEN }}" | ||
| BATON_ENTERPRISE_TOKEN: "${{ secrets.BATON_ENTERPRISE_TOKEN }}" | ||
|
|
||
| steps: | ||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.25.x | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Build baton-slack | ||
| run: go build ./cmd/baton-slack | ||
|
|
||
| - name: Run baton-slack | ||
| run: ./baton-slack | ||
| - name: Install baton | ||
| run: ./scripts/get-baton.sh && mv baton /usr/local/bin | ||
|
|
||
| - name: Grant enterprise role first time | ||
| run: | | ||
| ./baton-slack --grant-entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" \ | ||
| --grant-principal="${{ env.CONNECTOR_PRINCIPAL }}" \ | ||
| --grant-principal-type="${{ env.CONNECTOR_PRINCIPAL_TYPE }}" | ||
|
|
||
| - name: Check for enterprise role grant before revoking | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status ".grants[].principal.id.resource == \"${{ env.CONNECTOR_PRINCIPAL }}\"" | grep -q "true" | ||
|
|
||
| - name: Revoke enterprise role grant | ||
| run: ./baton-slack --revoke-grant="${{ env.CONNECTOR_GRANT }}" | ||
|
|
||
| - name: Check enterprise role grant was revoked | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status "if .grants then .grants[]?.principal.id.resource != \"${{ env.CONNECTOR_PRINCIPAL }}\" else . end" | ||
|
|
||
| - name: Grant enterprise role second time | ||
| run: | | ||
| ./baton-slack --grant-entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" \ | ||
| --grant-principal="${{ env.CONNECTOR_PRINCIPAL }}" \ | ||
| --grant-principal-type="${{ env.CONNECTOR_PRINCIPAL_TYPE }}" | ||
|
|
||
| - name: Check enterprise role was re-granted | ||
| run: | | ||
| ./baton-slack && \ | ||
| baton grants --entitlement="${{ env.CONNECTOR_ENTITLEMENT }}" --output-format=json | \ | ||
| jq --exit-status ".grants[].principal.id.resource == \"${{ env.CONNECTOR_PRINCIPAL }}\"" | grep -q "true" | ||
|
|
||
|
|
||
| connector: ./baton-slack | ||
| baton-entitlement: 'group:S0A1RHL4CP5:member' | ||
| baton-principal: 'U0847EPUZ0R' | ||
| baton-principal-type: 'user' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a newer version of the sync test now.