Skip to content

Commit

Permalink
Nit 822 (#21)
Browse files Browse the repository at this point in the history
* add CRC user script

* add click cmd

* add deactivate-crc-users to main group

* Update user.py

* Update requirements.txt

* Update rbac.py

* no token needed for rbac

---------

Co-authored-by: Seb Norris <[email protected]>
  • Loading branch information
georgepstaylor and Seb Norris authored Sep 11, 2023
1 parent f8e0fb4 commit 7c1a1cc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cli/ldap/rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
import cli.template
from ldif import LDIFParser

#### example for token auth
# def get_repo_with_token(repo_tag="master"):
# app_id = env.vars.get("GH_APP_ID")
# private_key = env.vars.get("GH_PRIVATE_KEY")
# installation_id = env.vars.get("GH_INSTALLATION_ID")
# token = git.get_access_token(app_id, private_key, installation_id)


def get_repo(repo_tag="master"):
app_id = env.vars.get("GH_APP_ID")
private_key = env.vars.get("GH_PRIVATE_KEY")
installation_id = env.vars.get("GH_INSTALLATION_ID")
# url = 'https://github.com/ministryofjustice/hmpps-delius-pipelines.git'
url = "https://github.com/ministryofjustice/hmpps-ndelius-rbac.git"
token = git.get_access_token(app_id, private_key, installation_id)
try:
repo = git.get_repo(url, token=token, dest_name="rbac", branch_or_tag=repo_tag)
repo = git.get_repo(url, dest_name="rbac", branch_or_tag=repo_tag)
return repo
except Exception as e:
log.exception(e)
Expand Down

0 comments on commit 7c1a1cc

Please sign in to comment.