Skip to content

Extensible? #11

@akamanocha

Description

@akamanocha

A general question to ask -

The idea is very nice. And I touched this repo 3 months back. I am having a relook. And probably recollecting the things here?

The project is very nice but if I am not wrong there is no way I can add my own middleware in middleware directory like for example

from toolz import merge
from ..formation import _REQ_HTTP


def auth(auth_key=None, access_token=None, content_type='application/json'):
    def auth_middleware(ctx, call):
        req = ctx.get(_REQ_HTTP)
        req.headers = merge(req.headers, {
            'auth_key': auth_key,
            'access_token': access_token,
            'content-type': content_type
        })
        return call(ctx)

    return auth_middleware

And then changing the below file too like

formation/middleware/init.py

from .auth import auth # noqa

So far so good but then I will have bump up the version

formation/version.py

OR raise a PR.

This method / process doesn't seem a lot extensible. Is the extensibility thing missing? Or is there workaround on the release thing? Can I fork and and release it some other name /formation-clone with your @jondot permission of course. I am asking permission here.

May be a newbie question or I misunderstood something.
I want to release a bit of functionality. like the auth above and playing with https://pypi.org/project/py-zipkin/ integration. Have 2 -3 ideas in mind, really want to explore.
Will that be ok?

Or need your guidance (sorry for newbie question)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions