Hi! :wave: I was wondering if there's a way to imp...
# general
m
Hi! 👋 I was wondering if there's a way to import the Go packages from
<http://github.com/ory/kratos|github.com/ory/kratos>
and
<http://github.com/ory/keto|github.com/ory/keto>
that live under
internal/
in your own Go project. E.g. to leverage the low-level behavior from the internal packages but without running Kratos and Keto standalone. (Please ignore for a moment the very valid question/argument of why you would even want to do such a thing).
s
I guess you have to work with a fork, as go itself does not let you import those
but why would you even want to do such a thing? 😜
😂 3
m
I could see myself building a (micro) SaaS, leveraging the various projects from the Ory ecosystem, but (initially) avoid the mental/operational overhead (even though pretty minimal) of running separate services for auth-z.
s
hm I see, so you want to bundle them as one binary?
m
Another use case would be to use a custom storage backend (e.g. for Spanner or DynamoDB) -- but maybe this is possible already?
hm I see, so you want to bundle them as one binary?
Yes. As a dev it would be pretty sweet if I can take all the sweetness of Ory (e.g. OIDC, crypto best practices, Google Zanzibar implementation) but without the RPC/ transport side
s
I recommend you import the commands instead, it is 💯 % possible to run keto (and I think also kratos) from within go: https://gist.github.com/zepatrik/8616cc59843fd8f4ad88a3fe1e7078b3
but that still starts a server and you need to interface through http
problem is: we don't have internal API stability, and we will probably never have that
m
Yeah; I figured that's the reason they're
internal
in the first place
s
exactly
m
Would be cool if (eventually) the API stabilizes even more to make them non-internal, or separate Go modules perhaps?
s
we could at some point expose public functions that talk to the internal API, but only provide high level capabilities similar to the APIs
💡 1
m
Similar to how Caddy for instance imports CertMagic, but you can also import and use CertMagic embedded in your own Go projects for automatic TLS management
s
it will never be feasable to expose all internal details IMO
but some go interface makes sense at some point
not in the near future IMO though
👍 1
m
Thanks for the quick response and elaborating/exploring! 🙏