-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add support for a mapping file #3
Comments
short-term fix for this could be to wrap the script... #!/usr/bin/env python
script_dir = os.path.dirname(os.path.realpath(__file__))
settings_file = "{}/settings.ini".format(script_dir)
DATAFILE = "mapping.csv"
# Format the mapping file like this
#<org>,<team>,<ldap-group>
try:
with open(DATAFILE) as datafile:
for line in datafile:
[ org, team, group ] = line.split(",")
try:
syncstr = "--sync --org {} --team {} --group {}".format(org, team, group)
print("Syncing ORG: {}, TEAM: {}, LDAP_GROUP: {}".format(org, team, group)
os.system("{}/SAMLTeamSyncAD.py {}".format(script_dir, syncstr))
except:
raise
except:
raise
print "Sync completed!!" |
@primetheus If we are using GitHub enterprise service account user(API token) which will have access to all the organizations, so, in this case, get the teams from each org and search that team in LDAP, if we found the GHE-Team in LDAP groups then we have to sync, if not then leave it and continue to the next team, it should be done for all ORGS. Thanks |
@kumar0608 thanks for this context! So, if I’m understanding this correctly, the functionality you’d like to see is:
Is that accurate? I think that is pretty feasible and should be simple to implement. Then the additional flags can serve as overrides or additions. |
yes exactly. |
@kumar0608 #33 is ready for testing, if you'd like to try it out. The README of that branch has been updated with instructions |
Hi Jared
I got little confused with usage
Could you please help me
…On Wednesday, July 1, 2020, Jared Murrell ***@***.***> wrote:
Closed #3 <#3> via #33
<#33>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEMZET7UFNMS3QZ6IQEPJELRZPHIXANCNFSM4GDJKKLA>
.
|
Hi Jarad,
i need some help on the version2, few questions regarding readme file and
usage
Thanks
Sridhar
…On Wed, Jul 1, 2020 at 5:31 PM Pragnya Ravula ***@***.***> wrote:
Hi Jared
I got little confused with usage
Could you please help me
On Wednesday, July 1, 2020, Jared Murrell ***@***.***>
wrote:
> Closed #3 <#3> via
> #33 <#33>.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#3 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEMZET7UFNMS3QZ6IQEPJELRZPHIXANCNFSM4GDJKKLA>
> .
>
|
Hi Jarad,
am getting initial setup errors,
/usr/local/bin/python3
/Users/sravula/Downloads/saml-ldap-team-sync-2.0/app.py
Traceback (most recent call last):
File "/Users/sravula/Downloads/saml-ldap-team-sync-2.0/app.py", line 11,
in <module>
from githubapp import GitHubApp, LDAPClient, CRON_INTERVAL, TEST_MODE
File
"/Users/sravula/Downloads/saml-ldap-team-sync-2.0/githubapp/__init__.py",
line 26, in <module>
OPEN_ISSUE_ON_FAILURE =
strtobool(os.environ.get('OPEN_ISSUE_ON_FAILURE', False))
File
"/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/util.py",
line 301, in strtobool
val = val.lower()
AttributeError: 'bool' object has no attribute 'lower'
Process finished with exit code 1
can you guide me
…On Wed, Jul 1, 2020 at 10:47 PM Pragnya Ravula ***@***.***> wrote:
Hi Jarad,
i need some help on the version2, few questions regarding readme file and
usage
Thanks
Sridhar
On Wed, Jul 1, 2020 at 5:31 PM Pragnya Ravula ***@***.***> wrote:
> Hi Jared
>
> I got little confused with usage
>
> Could you please help me
>
> On Wednesday, July 1, 2020, Jared Murrell ***@***.***>
> wrote:
>
>> Closed #3 <#3> via
>> #33 <#33>.
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#3 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AEMZET7UFNMS3QZ6IQEPJELRZPHIXANCNFSM4GDJKKLA>
>> .
>>
>
|
Add user to organization if found
At present, this script requires each team and group to be sync'ed separately. This means creating a wrapper to run
python SAMLTeamSyncAD.py -g <ad_group> -t <gh_team> -o <gh_org> -s
repeatedly to sync multiple teams. You can accomplish this with a wrapper script, but it would be ideal if this script could handle the mapping of multiples at once, fed via YAMLThe text was updated successfully, but these errors were encountered: