-
Notifications
You must be signed in to change notification settings - Fork 10
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
C2S/S2S are not embedded interfaces (iterate on Application & related interfaces) #46
Comments
okay so maybe I don't understand the language. I still think it doesn't seem right to mix two interfaces together like that when Go works better with their clean separation. |
right, yeah, so like
then I could do like
That'd let us write S2S applications that are not C2S, or C2S applications that aren't S2S though I can't imagine why anyone would want to do that. Test suites? |
(Re-opening the issue) Thanks for the feedback! Truth be told, I have mainly been refactoring the guts of the application and haven't really focused on iterating on the Application interface itself, so I really appreciate this. I was punting on dealing with this until I (or someone) took #27 (the existing example is currently broken). The way I envision
So these questions are more related to "how to pick a strategy for federated software", and less around "how to authorize users". The latter is more geared towards those authorization flows you mention ( |
To elaborate on the history why they are not composable interfaces currently (like, say, how I began apcore before I just haven't had the time/chance to re-examine the |
On a technical note, from what I learned from
Because an Application will not be able to support both Instead it will need to be:
Which permits this composition feature. However, it is slightly annoying for the framework because if a function relies on methods from both
or
or something else. I'm OK with the framework shouldering the burden of this awkwardness in the Go language, if it means people using |
I am insufficiently skilled in Go to gauge the deeper implications, but here's my 2 cts..
Is it really that awkward? You say " Some questions: What would "shouldering the burden in the framework" entail? Hiding the inconvenience from implementers? You've marked as 'feature'.. does it involve a lot of work at the go-fed end, and would the impact of changes on existing implementers be high?
This is where my use case, Groundwork project, is focused on. It would be positioned as "Built on top of the solid Go-Fed foundation, with [full pub/apcore feature list] and adding 'Dynamic service modules' and 'Service management'..". |
When Go interfaces are uncomposed from one another, then casting from one interface to another is exactly that: a casting statement. Breaking apart a monolithic interface is going to introduce those statements somewhere, which can indeed be done poorly/awkwardly. I hope to avoid that. :) Note: in the "composition vs inheritance" debate, Go chose "composition" (there is no inheritance, besides the implicit duck-typing of structs to fulfill interfaces).
It is some work, I wouldn't say a lot, but the way it could be expressed in the codebase is potential for unwieldiness. It's just making sure the bookkeeping doesn't become a burden.
No concrete codebases of this lib yet, as far as I'm aware :) FWIW my mental model is to allow making major sweeping (breaking) changes during
I think that's worthy of being a separate issue entirely. Depending on the particulars, the |
Completely agree. Thanks for the elaboration. |
OK, I've done an iteration in 289217f I think there is a possibility the |
Hey @cyisfor let me know if you have a chance to re-review the interfaces, feedback appreciated! |
Without further input, I'm going to bump this issue to the next milestone version, so that any further changes can be expected to be a part of that one. I'd like to take the current one into |
I know golang has a thing where you can go:
Instead go-fed requires we implement a C2SEnabled/S2SEnabled function. I was thinking of making an AP server that had a GUI interface with no C2S at all, but because Application piles C2S and S2S functions all into one interface, it doesn't matter whether I return false from C2SEnabled. I still have to implement stubs for all the client to server functions, login, oauth, etc, and it still listens to URLs like
/login
for no reason.if(C2SEnabled(app))
could always be written more likeif(app.(C2SApp) !== nil)
unless I seriously misunderstand the Go language, which is entirely possible.The text was updated successfully, but these errors were encountered: