{"id":22621446,"url":"https://github.com/cca/cca_utils","last_synced_at":"2025-08-05T20:32:34.983Z","repository":{"id":29085237,"uuid":"32613529","full_name":"cca/cca_utils","owner":"cca","description":"Re-usable python functions for decoupled interactions with CCA campus services","archived":false,"fork":false,"pushed_at":"2018-07-23T19:04:47.000Z","size":45,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-04-15T04:00:35.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-21T00:15:16.000Z","updated_at":"2024-04-15T04:00:35.282Z","dependencies_parsed_at":"2022-08-17T21:50:19.148Z","dependency_job_id":null,"html_url":"https://github.com/cca/cca_utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cca%2Fcca_utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cca%2Fcca_utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cca%2Fcca_utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cca%2Fcca_utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cca","download_url":"https://codeload.github.com/cca/cca_utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228805402,"owners_count":17974773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T23:09:12.840Z","updated_at":"2024-12-08T23:09:39.688Z","avatar_url":"https://github.com/cca.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cca_utils\n\nRe-usable python functions for decoupled interactions with various LDAP and Google functions, services and APIs. It is unlikely these will work for you as-is; contributions welcome.\n\nCurrently assuming Python 2 due to slow migration of some external dependencies.\n\nSome functions make full or partial assumptions about organization-specific LDAP fields (look for string 'cca' to locate them).\n\n### LDAP function list\n\n```\nget_all_entitlements\nget_email_aliases\nget_user_entitlements\nldap_add_members_to_group\nldap_change_password\nldap_connect\nldap_create_group\nldap_create_user\nldap_delete_group\nldap_delete_user\nldap_enable_disable_acct\nldap_generate_uidnumber\nldap_generate_username\nldap_get_all_groups\nldap_get_all_users\nldap_get_group\nldap_get_next_gidNumber\nldap_get_user_data\nldap_iterate_username\nldap_remove_members_from_group\nldap_search\nreplace_email_aliases\nreplace_user_entitlements\n```\n\n### Google function list\n\n```\ngoogle_create_user\ngoogle_get_auth\ngoogle_get_emailsettings_credentials\ngoogle_get_user\ngoogle_remove_user\ngoogle_set_aliases\ngoogle_update_user\n```\n\n\n## Dependencies\n(most likely found in the `requirements.txt` of a parent Django project):\n\n```\ngoogle-api-python-client\nPyOpenSSL\ngdata\nbeautifulsoup4\npasslib\n```\n\n## Settings\n\nAssumed to be established in your Django or Flask project:\n\n```\nLDAP_BASE_DN = 'dc=cca,dc=edu'\nLDAP_PEOPLE_OU = 'ou=People,dc=cca,dc=edu'\nLDAP_GROUPS_OU = 'ou=Groups,dc=cca,dc=edu'\nLDAP_SERVER = 'ldap://directory.yourdomain.org'\nLDAP_AUTH_SEARCH_DN = 'uid=search,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot'\nLDAP_AUTH_MODIFY_DN = 'cn=Directory Manager'\nLDAP_SEARCH_PASS = 'the_search_pass'\nLDAP_MODIFY_PASS = 'record_modification_pass'\n\nGOOGLE_DOMAIN = 'yourdomain.org'\nGOOGLE_CLIENT_EMAIL = '12345678-abc23@developer.gserviceaccount.com'\nGOOGLE_PATH_TO_KEYFILE = \"/full/path/to/our_key_file.p12\"\nGOOGLE_CLIENT_SECRET = 'abc123'\nGOOGLE_SUB_USER = 'someone@yourdomain.org'  # Email of a superuser on your domain\nGOOGLE_APPLICATION_NAME = 'our-project-name'  # As listed in Google Developers Console\n```\n\n## Tests\n\nThis library is intended to be used either with or without a Django project. However, it depends on a lot of settings (above), typically associated with Django. If you are working with it outside of Django or want to run the tests standalone, create a `cca_utils/test_settings.py` file and change this line in `ldap_utils.py`:\n\n```\n# from django.conf import settings\nimport test_settings as settings\n```\n\nTo run all tests:\n\n```nosetests```\n\nTo run a single test:\n\n```nosetests tests:TestClass.test_add_members_to_group```\n\nTo prevent print debug print statements from being swallowed:\n\n```nosetests -s ....```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcca%2Fcca_utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcca%2Fcca_utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcca%2Fcca_utils/lists"}