Package: lg-april-permissions
buditoolDas Tool dient hauptsächlich zum synchronisieren von Berechtigungen: es schaut in die Postgres-DB (April_Permissions) und schickt API calls an Budibase, um die Berechtigungen zu setzten. Bitte auch die KNOWN ISSUES in tests/bb_test.py lesen! Die entsprechenden Images werden über die CI gebaut und können einfach von unserer Registry gepullt werden:buditool --serve:https://git.itsnow.biz/LG-IT/docker-lg-april-permissionsPostgres mit curl:https://git.itsnow.biz/LG-IT/docker-lg-postgresall unsere Images (heißt hier Packges):https://git.itsnow.biz/LG-IT/-/packagesFeatureskmille@linbox:lg-april-permissions~/.local/bin/buditool-h
usage:buditool[-h][-uUSER][--list-apps][--list-users][-aADD_PERMISSIONS][-rREMOVE_PERMISSIONS][-s][-cCONFIG][--version]options:-h,--helpshowthishelpmessageandexit-uUSER,--userUSERshowuser(needsbbuserid)--list-appslistallbbapps--list-userslistallbbusers-aADD_PERMISSIONS,--add-permissionsADD_PERMISSIONSaddpermissionsforuser(needsbbuserid)-rREMOVE_PERMISSIONS,--remove-permissionsREMOVE_PERMISSIONSremovepermissionsforuser(needsbbuserid)-s,--syncsynchronizepermissionswithdb-cCONFIG,--configCONFIGconfigfile--versionshowversionConfiguration (settings.yaml.template)---bb_base_api_url:"https://bb-test.itsnow.biz/api/public/v1/"bb_api_key:""permissions:"app_dev_908c8e8aad04477183ee858c3c29f0d5":"BASIC"# Protestbuffetdb_connection:"dbname=aauser=aahost=127.0.0.1password=port=10002"Run testskmille@linbox:lg-april-permissionspoetryinstall
Installingdependenciesfromlockfile

Nodependenciestoinstallorupdate

Installingthecurrentproject:lg-april-permissions(0.1.0)kmille@linbox:lg-april-permissionspoetryrunpytest-x-v-s=============================================================================================================testsessionstarts=============================================================================================================platformlinux--Python3.10.10,pytest-7.2.2,pluggy-1.0.0--/home/kmille/.cache/pypoetry/virtualenvs/lg-april-permissions-bzz6vhyK-py3.10/bin/python
cachedir:.pytest_cache
rootdir:/home/kmille/projects/letzte-generation/lg-april-permissions
collected1item

tests/bb_test.py::TestAPI::test_roles{}{}{'app_908c8e8aad04477183ee858c3c29f0d5':'BASIC'}{}{'app_908c8e8aad04477183ee858c3c29f0d5':'BASIC'}{'app_908c8e8aad04477183ee858c3c29f0d5':'POWER'}{}PASSED==============================================================================================================1passedin3.25s==============================================================================================================kmille@linbox:lg-april-permissionsBuild and installationkmille@linbox:lg-april-permissionspoetrybuild
Buildinglg-april-permissions(0.1.0)-Buildingsdist-Builtlg_april_permissions-0.1.0.tar.gz-Buildingwheel-Builtlg_april_permissions-0.1.0-py3-none-any.whl
kmille@linbox:lg-april-permissionspipinstall--userdist/lg_april_permissions-0.1.0-py3-none-any.whl
Processing./dist/lg_april_permissions-0.1.0-py3-none-any.whl
Requirementalreadysatisfied:pyyaml<7.0,>=6.0in/usr/lib/python3.10/site-packages(fromlg-april-permissions==0.1.0)(6.0)Requirementalreadysatisfied:requests<3.0.0,>=2.28.2in/home/kmille/.local/lib/python3.10/site-packages(fromlg-april-permissions==0.1.0)(2.28.2)Collectingpsycopg2-binary<3.0.0,>=2.9.6Downloadingpsycopg2_binary-2.9.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl(3.0MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━3.0/3.0MB7.4MB/seta0:00:00
Requirementalreadysatisfied:charset-normalizer<4,>=2in/home/kmille/.local/lib/python3.10/site-packages(fromrequests<3.0.0,>=2.28.2->lg-april-permissions==0.1.0)(3.1.0)Requirementalreadysatisfied:urllib3<1.27,>=1.21.1in/home/kmille/.local/lib/python3.10/site-packages(fromrequests<3.0.0,>=2.28.2->lg-april-permissions==0.1.0)(1.26.15)Requirementalreadysatisfied:idna<4,>=2.5in/home/kmille/.local/lib/python3.10/site-packages(fromrequests<3.0.0,>=2.28.2->lg-april-permissions==0.1.0)(3.4)Requirementalreadysatisfied:certifi>=2017.4.17in/home/kmille/.local/lib/python3.10/site-packages(fromrequests<3.0.0,>=2.28.2->lg-april-permissions==0.1.0)(2022.12.7)Installingcollectedpackages:psycopg2-binary,lg-april-permissionsWARNING:Thescriptbuditoolisinstalledin'/home/kmille/.local/bin'whichisnotonPATH.ConsideraddingthisdirectorytoPATHor,ifyouprefertosuppressthiswarning,use--no-warn-script-location.
Successfullyinstalledlg-april-permissions-0.1.0psycopg2-binary-2.9.6Walkthroughkmille@linbox:lg-april-permissions~/.local/bin/buditool-uus_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6{"data":{"_id":"us_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6","email":"abc@mail.com","status":"active","firstName":"Hans","lastName":"Nani","forceResetPassword":false,"roles":{"app_7c5f5f30d8254721bc04e2c98249f31c":"BASIC"}}}kmille@linbox:lg-april-permissions~/.local/bin/buditool--sync
Syncingpermissionswithdatabase
ProcessingBikö159Budibaseuserid:us_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6(HansiNani)Addingpermissionsforuserus_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6
Rollenvorher:{"app_7c5f5f30d8254721bc04e2c98249f31c":"BASIC"}Rollendanach:{"app_7c5f5f30d8254721bc04e2c98249f31c":"BASIC","app_908c8e8aad04477183ee858c3c29f0d5":"BASIC"}kmille@linbox:lg-april-permissions~/.local/bin/buditool-uus_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6{"data":{"_id":"us_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6","email":"abc@mail.com","status":"active","firstName":"Hans","lastName":"Nani","forceResetPassword":false,"roles":{"app_7c5f5f30d8254721bc04e2c98249f31c":"BASIC","app_908c8e8aad04477183ee858c3c29f0d5":"BASIC"}}}kmille@linbox:lg-april-permissions~/.local/bin/buditool-rus_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6
Removingpermissionsforuserus_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6
Rollenvorher:{"app_7c5f5f30d8254721bc04e2c98249f31c":"BASIC","app_908c8e8aad04477183ee858c3c29f0d5":"BASIC"}Rollendanach:{"app_7c5f5f30d8254721bc04e2c98249f31c":"BASIC"}kmille@linbox:lg-april-permissions~/.local/bin/buditool-uus_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6{"data":{"_id":"us_ee81b34c-f7ea-4bbd-8faf-d8a83889dff6","email":"abc@mail.com","status":"active","firstName":"Hans","lastName":"Nani","forceResetPassword":false,"roles":{"app_7c5f5f30d8254721bc04e2c98249f31c":"BASIC"}}}