Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow loading of connectors from .so files #1302

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

amdonov
Copy link

@amdonov amdonov commented Sep 21, 2018

Forgive me if this has come up before. I didn't see an issue for it. I thought it would be cool to allow developers to load connectors from .so files using Go's plugin features. I created a connector that enables this and a plugin that shows how it works.

You create the sample.so file with the following command.

go build -buildmode=plugin -o sample.so ./connector/sample-plugin/

Then, you can load it and configure it with the following in your configuration.

  - id: test
    name: test
    type: plugin
    config:
      plugin: sample.so
      config:
        name: sample
        options: limitless

Seemed like a pretty cool feature that would keep you from getting requests for new connectors all the time, and it doesn't change your API in any way.

I've had to fork dex, and I'd really like to avoid it. While the proposed grpc connector is a good idea, it's really nice not to run another process.

Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great idea. Depending on the deployment scenario, #1020 could still be simpler to use for people who consume dex through the docker image; but for many others, this indeed opens up limitless options 😉

Could you add a small connector/plugin/README.md, and have it state that there's no guarantees of any kind in terms of API stability, or something like that?

@ericchiang What do you think? I suppose with a non-compat caveat like that, this could go in.

connector/plugin/plugin.go Show resolved Hide resolved
@ericchiang
Copy link
Contributor

Plugin's are going to have the same pain as we update interfaces or deploy new versions of Go (golang/go#17832). I don't get why this deployment strategy is better than forking dex.

@amdonov
Copy link
Author

amdonov commented Sep 24, 2018

I'm of the opinion that forks lead to fragmentation that's not helpful. You can see it with the some of the forks for dex now. Someone might fork just to change a connector, but then they're free to change any and everything like dropping glide for modules, implementing UserInfo, etc. In most cases they're not contributing those changes back. Why go through the headaches of getting a merge prepared and approved? They can keep the change local and move on. If you provide key extension points, you can keep those developers engaged and contributing to your project.

@nabokihms
Copy link
Member

Related issue #1907
Currently, we are working on a design dock to provide custom connectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants