Skip to content
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

Improvement to CS conversion #191

Open
2 of 4 tasks
chrisburr opened this issue Dec 7, 2023 · 3 comments
Open
2 of 4 tasks

Improvement to CS conversion #191

chrisburr opened this issue Dec 7, 2023 · 3 comments
Assignees

Comments

@chrisburr
Copy link
Member

chrisburr commented Dec 7, 2023

  • DisabledVOs cannot be set if any Legacy clients are enabled. Should fail during conversion
  • Set subs for dteam for all users
  • Import subs from IdP
  • Move conversion config to DiracX part of the old CS
@chrisburr
Copy link
Member Author

Can we call the cs sync when committing in legacy DIRAC so errors get reported?

@chaen
Copy link
Contributor

chaen commented Jan 22, 2024

note for me for later to sync the users:

curl -q -L -s  -u ${CLIENT_ID}:${CLIENT_SECRET}  -d grant_type=client_credentials -d scope=iam:admin.read     ${IAM_TOKEN_ENDPOINT} > /tmp/token.json

export AT=$(cat /tmp/token.json  | jq ".access_token")
import requests, json
import os
token = os.environ.get('AT')

headers = {"Authorization": f"Bearer {token}"}
iam_list_url = 'https://lhcb-auth.web.cern.ch/iam/account/search'
results = []
startIndex = 1
totalResults = 1000  # total number of users
itemsPerPage = 10
while(startIndex < totalResults):
    resp = requests.get(iam_list_url, headers=headers, params = {'startIndex':startIndex})
    resp.raise_for_status()
    data = resp.json()
    # These 2 should never change, but just to be sure...
    totalResults = data['totalResults']
    itemsPerPage = data['itemsPerPage']

    startIndex += itemsPerPage
    results.extend(data['Resources'])
with open('accounts.json', 'w+') as fp:
    fp.write(json.dumps(results))

@chaen
Copy link
Contributor

chaen commented Jan 23, 2024

Can we call the cs sync when committing in legacy DIRAC so errors get reported?

as discussed offline, the cs-sync can be ran at every commit, but the sync between IAM and the CS (for the users subs) takes too long ,and will be done in the VOMS2CSAgent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants