Python implementation of SAML2 protocol for app engine on Google cloud platform -
i tried pysaml2 , python-saml library on google cloud platform both internally using libraries using c extensions or python wrapper on c libraries incompatible app engine app engine blocks c implemented libraries in eco system. 1 has implemented saml2 protocol in appengine using python?
pysaml2 documentation suggests pure python implementation uses library pycrytodome or cryptodome need _ctype library.
below error:
file "/home/***/anaconda2/lib/python2.7/ctypes/_init_.py", line 10, in <module> _ctypes import union, structure, array file "/home/***/sdks/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 963, in load_module raise importerror('no module named %s' % fullname) importerror: no module named _ctypes
please suggest other approaches if possible.
i figured out if want use c libraries in app engine environment. first of have use app engine flexible environment instead of standard environment there use custom runtime. sample yaml file posted below.
app.yaml
runtime: custom env: flex api_version: 1 handlers: - url: /.* script: main.app second thing need choose proper base image build , install necessary libraries.
example dockerfile
from gcr.io/google_appengine/python-compat-multicore run apt-get update -y run apt-get install -y python-pip build-essential libssl-dev libffi-dev python-dev libxml2-dev libxslt1-dev xmlsec1 run apt-get install -y curl unzip run curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz run mkdir -p /usr/local/gcloud run tar -c /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz run /usr/local/gcloud/google-cloud-sdk/install.sh run curl https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.40.zip > /tmp/google_appengine_1.9.40.zip run unzip /tmp/google_appengine_1.9.40.zip -d /usr/local/gae env path $path:/usr/local/gcloud/google-cloud-sdk/bin env path $path:/usr/local/gae/google_appengine/ copy . /app workdir /app env module_yaml_path app.yaml run pip install -r requirements.txt
Comments
Post a Comment