Updating baton capabilities. #189
This file contains 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
name: CI Tests | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
push: | |
branches: | |
- main | |
jobs: | |
go-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run linters | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
args: --timeout=3m | |
go-test: | |
strategy: | |
matrix: | |
go-version: [1.22.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install Go | |
if: success() | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: go tests | |
run: go test -v -covermode=count -json ./... > test.json | |
- name: annotate go tests | |
if: always() | |
uses: guyarb/[email protected] | |
with: | |
test-results: test.json | |
test: | |
runs-on: ubuntu-latest | |
services: | |
openldap: | |
image: osixia/openldap:latest | |
ports: | |
- "389:389" | |
- "636:636" | |
env: | |
LDAP_ORGANISATION: example | |
LDAP_DOMAIN: example.org | |
LDAP_ADMIN_USERNAME: admin | |
LDAP_ADMIN_PASSWORD: admin | |
LDAP_CONFIG_PASSWORD: config_pass | |
LDAP_BASE_DN: "dc=example,dc=org" | |
BITNAMI_DEBUG: true | |
LDAP_REMOVE_CONFIG_AFTER_SETUP: false | |
LDAP_ENABLE_TLS: true | |
LDAP_LDAPS_PORT_NUMBER: 636 | |
LDAP_TLS_CERT_FILE: /container/service/slapd/assets/certs/ldap.crt | |
LDAP_TLS_KEY_FILE: /container/service/slapd/assets/certs/ldap.key | |
LDAP_TLS_CA_FILE: /container/service/slapd/assets/certs/ca.crt | |
LDAP_TLS_VERIFY_CLIENT: try | |
env: | |
BATON_PASSWORD: admin | |
BATON_BASE_DN: 'dc=example,dc=org' | |
BATON_USER_DN: 'CN=admin,DC=example,DC=org' | |
BATON_URL: 'ldaps://localhost' | |
BATON_INSECURE_SKIP_VERIFY: true | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '21.x' | |
- name: Install ldapadd | |
run: sudo apt install ldap-utils | |
- name: Create ldif files | |
run: node ./scripts/ldif.js && ls -la | |
- name: Import ldif into openldap | |
run: ./scripts/import.sh | |
- name: Build baton-ldap | |
run: go build ./cmd/baton-ldap | |
- name: Run baton-ldap | |
run: ./baton-ldap | |
- name: Revoke grants | |
run: ./baton-ldap --revoke-grant 'group:cn=testgroup00000,dc=example,dc=org:member:user:[email protected],dc=example,dc=org' && ./baton-ldap --revoke-grant 'group:cn=othertestgroup00000,dc=example,dc=org:member:user:[email protected],dc=example,dc=org' | |
- name: Grant entitlements | |
run: ./baton-ldap --grant-entitlement 'group:cn=testgroup00000,dc=example,dc=org:member' --grant-principal '[email protected],dc=example,dc=org' --grant-principal-type 'user' && ./baton-ldap --grant-entitlement 'group:cn=othertestgroup00000,dc=example,dc=org:member' --grant-principal '[email protected],dc=example,dc=org' --grant-principal-type 'user' |