Giter Site home page Giter Site logo

olitheolix / aiokubernetes Goto Github PK

View Code? Open in Web Editor NEW
25.0 5.0 2.0 1.23 MB

Asynchronous Kubernetes Client

Home Page: https://aiokubernetes.readthedocs.io/en/latest/

License: Apache License 2.0

Python 99.96% Shell 0.04%
python3 async-python kubernetes aiohttp async aiokubernetes python

aiokubernetes's People

Contributors

olitheolix avatar tantioch avatar yuvipanda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

tantioch revoteon

aiokubernetes's Issues

Too many dependencies

I already have aiohttp, it seems silly to install requests. But aiokubernetes forces me to.

aiokubernetes doesn`t work with insecure-skip-tls-verify option

Hello,

When I used insecure-skip-tls-verify option in kubeconfig file I got an error

Traceback (most recent call last):
  File "/Users/obloshenkin/my_project/learn_angular/api_health_chek/examples/async_kubectl.py", line 42, in <module>
    loop.run_until_complete(main())
  File "/Users/obloshenkin/.pyenv/versions/3.6.5/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/Users/obloshenkin/my_project/learn_angular/api_health_chek/examples/async_kubectl.py", line 9, in main
    context='preprod'
  File "/Users/obloshenkin/.pyenv/versions/3.6.5/lib/python3.6/site-packages/aiokubernetes/config/kube_config.py", line 477, in new_client_from_config
    return ApiClient(configuration=client_config)
  File "/Users/obloshenkin/.pyenv/versions/3.6.5/lib/python3.6/site-packages/aiokubernetes/api_client.py", line 88, in __init__
    verify_ssl=configuration.verify_ssl
  File "/Users/obloshenkin/.pyenv/versions/3.6.5/lib/python3.6/site-packages/aiohttp/connector.py", line 643, in __init__
    fingerprint)
  File "/Users/obloshenkin/.pyenv/versions/3.6.5/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 118, in _merge_ssl_params
    raise ValueError("verify_ssl, ssl_context, fingerprint and ssl "
ValueError: verify_ssl, ssl_context, fingerprint and ssl parameters are mutually exclusive

My kubeconfig:

apiVersion: v1
kind: Config
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://hostname-address:6443
  name: preprod

This error raised for me because in the module init() contains these changes:

ssl_context = ssl.create_default_context(cafile=ca_certs)
        if configuration.cert_file:
            ssl_context.load_cert_chain(
                configuration.cert_file, keyfile=configuration.key_file
            )

        connector = aiohttp.TCPConnector(
            limit=4,
            ssl_context=ssl_context,
            verify_ssl=configuration.verify_ssl
        )

Please help me.

Thank you.

JWT tokens fail to load when not padded (as specced by RFC7515)

_load_oid_token() currently doesn't support in-the-wild JWT tokens, which expect to be unpadded base64. https://www.rfc-editor.org/rfc/rfc7515.txt

   Base64url Encoding
      Base64 encoding using the URL- and filename-safe character set
      defined in Section 5 of RFC 4648 [RFC4648], with all trailing '='
      characters omitted (as permitted by Section 3.2) and without the
      inclusion of any line breaks, whitespace, or other additional
      characters.  Note that the base64url encoding of the empty octet
      sequence is the empty string.  (See Appendix C for notes on
      implementing base64url encoding without padding.)

to fix, https://github.com/olitheolix/aiokubernetes/blob/master/aiokubernetes/config/kube_config.py#L233 should look more like

jwt_data = parts[1]
jwt_data += '=' * (4 - len(jwt_data) % 4)
jwt_attributes = json.loads(base64.b64decode(jwt_data).decode('utf-8'))

Would PR this but it seems to have more implications in test than I have a jiffy fix for atm, so posting an issue for posterity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.