zitadel / oidc

Easy to use OpenID Connect client and server library written for Go and certified by the OpenID Foundation
https://zitadel.com
Apache License 2.0
1.33k stars 138 forks source link

Question about licensing #607

Closed NathanFirmo closed 3 months ago

NathanFirmo commented 4 months ago

I have a question about licensing. I'd like to know if I can use part of the code within the 'examples' folder for my open-source project, which is licensed under the MIT license.

If I do that, will I be violating any rules of the Apache license?

NathanFirmo commented 4 months ago

I do not put the repository link because its not done yet.

NathanFirmo commented 4 months ago

Sorry if my question was "dumb". I don't understand much about licenses yet.

muhlemmer commented 3 months ago

Hi, not a silly question at all and thanks for asking! In my opinion:

  1. If you use only snippets from the examples and build your own work around that, you are fine. There is usually just a single way a certain function can be used. If your work uses a function that is already in the example, in the same way, that would hardly be considered a copyright violation.
  2. You do not copy the complete example and build you work on that.

In practice, if you use the examples as a guide to build your own work, you should be fine. Copying the complete example means you are subject to copyright, as the name applies, under the license of this project. Apache is a permissive licence, a derivative work can have its own licence terms, but attribution to the original authors and the licence has to remain in place.

If you do need to copy the complete example for some reason, there can be a practical solution where you put the copied example code in a separate sub-directory or file of your project and include zitadel/oidc's LICENSE and NOTICE into that directory or file, while licencing the rest of your project under MIT. I greatly agree with the answer given here: https://opensource.stackexchange.com/a/9260.

@fforootd or @mffap should be able to confirm this.

mffap commented 3 months ago

Yes, agree as a general guidance. We are not able to give you legal advice if the license terms and requirements apply to your work, though. It is individual in all cases.

It might help to understand our motivations. By providing example code we want to encourage you to use our software in the spirit of open source - give feedback, voice your ideas, improve upon what we and the community have created. We ask to comply with the terms of the specific license in return for you to use the code for free. What we don't like to see is use without attributing the work of our community members.

I greatly agree with the answer given here: https://opensource.stackexchange.com/a/9260.

Yes that seems like some good practical guidance. The apache license file contains the boiler plate and instructions as well (see 'appendix').

hifabienne commented 3 months ago

I think we can close this issue, as the question is answered. Feel free to reopen if needed