Closed (fixed)
Project:
Version Control API
Version:
6.x-2.x-dev
Component:
API module
Priority:
Critical
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
8 Nov 2010 at 20:46 UTC
Updated:
3 Jan 2014 at 02:41 UTC
Jump to comment: Most recent
Comments
Comment #1
sdboyer commentedComment #2
sdboyer commentedOK, this has been a pretty revelatory few days wrt the VersioncontrolAccount mapping, and there's a LOT to say about it. I've got a longer comment, but I want to update this now before our scrum, so here's some relevant bullets:
We need to let the auth happen by hook, decouple the network user from commit user, and if we do end up keeping VersioncontrolAccount around, it'd only be useful as a tool for helping perform the mapping (vcs user info <-> drupal user info) logic. That too, though, needs to be pluggable.
Like I said, I'm gonna make a bigger follow-up that explains some of the theory here, but I wouldn't mind off-the-cuff thoughts, either - marvil07?
Comment #3
marvil07 commentedOk, I am no so in favour to remove account class completely, but I think backends account classes must implement logic about specific behaviour about its vcs.
I am completely in favour of re-visiting auth-methods: #223891: API change: make authentication management pluggable
Yep, we need to do that, but I do not see the need to remove the class, maybe is better to keep it and let the backends interact in critical moments like auth, and yes I was also thinking about the VersioncontrolAccount be only the drupal uid mapping(is that now the only thing that do?), and let the rest(needs to specify it) be extendable by backends as much as possible.
PS: status change as needs review means patches ;-)
Comment #4
sdboyer commentedBut what behavior? That's the real question. What behavior really BELONGS on a VersioncontrolAccount class?
I'm not saying there isn't an argument to be made for some - just that I don't feel like it's an unambiguously good idea. So, throw some things out there that ought to be on the class :P
Comment #5
marvil07 commentedNow {versioncontrol_accounts} table have:
Account class(and this table) now have one drupal uid per repository. INHO account must have its own id, so we can then reference many versioncontrol usernames pero drupal user/repository.
That way, general mapping should be handled by account class.
Joining this with the activity(now operations again) we could refer an account id in the activity table for any type of activity(commits, network operations, etc).
If I get with more uses I will post again :-)
Comment #6
marvil07 commentedIMHO using an account unique id and then calling a hook(used by modules like a-ssh-support-module) for authorization(account would have mapping to drupal users) is fine.
Am I missing something?
Comment #7
sdboyer commenteddammit, i've rewritten this post three times already. ok, short version - fine, let's introduce an
account_idon the versioncontrol_accounts table. maybe we don't end up using it much, but at the very least it'll let us get rid of the contorted multi-PK logic in the controller. let me note, though, that the operations table maps records a direct uid mapping, which very much should stay. there's no need or reason to map it through a secondary table. if we don't know what drupal user is responsible for a commit, we just put in 0.i could be convinced that we use the VersioncontrolAccount class as the central place for all our logic that helps manage the auth & committer info mappings. nothing's really for sure, though, until i've actually started to hack at the system and figure out what it's architecture ought to look like. TMTOWTDI...
Comment #8
sdboyer commentedMarking this postponed - it's gonna be one of the sprint 5 biggies.
Comment #9
eliza411 commentedsdboyer will be breaking this into two sub-issues, pluggable auth and pluggable mapping. When that's done, this issue should be closed.
Comment #10
marvil07 commentedIMHO this issue can stay for the pluggable mapping(not really sure why is mentioned as that, but I mean what I mention on #5) and use #223891: API change: make authentication management pluggable for the pluggable auth.
@sdboyer: is that ok?
Comment #11
sdboyer commentedI'd actually rather keep this as a meta-issue - #223891: API change: make authentication management pluggable is good for the auth, and I opened #979040: Make pluggable the process of mapping of raw vcs data to Drupal users for the mapping. I think there were some other things too, but I can't come up with them now, but will post links to them here as they come up.
I really want this issue to be ultimately closed at the end of this sprint - it'll be closed once we've closed all its sub-issues and are convinced the overall thing is done.
Comment #12
marvil07 commentedComment #13
greg.1.anderson commentedIt would be very nice if the new VersioncontrolAccount class and related code could be configured to not require the mapping table from Drupal account to VCS account. This would be very useful to anyone using mod_auth_mysql to authenticate their repository via Apache, where the Drupal username == the VCS username (presuming the Drupal usernames were constrained so that none contained characters illigal in the VCS). If an appropriate setting were selected (per VCS backend?), then the VersioncontrolAccount info could just be populated from the Drupal users table.
Comment #14
sdboyer commented@greg.1.anderson - check. if VersioncontrolAccount even continues to exist, it will definitely not use that mapping table, except perhaps optionally by a particular plugin.
In my initial work on this on Monday, I explored the possibility of introducing an 'owner' field on
VersioncontrolRepository, which would be a string containing the name of an owner plugin, that would then be responsible for doing things like managing auth and mapping. It seemed like a useful approach because it'd be a convenient, centralized way to designate in a single place that a given repository was owned by a particular module. However, that work ended up being a dead-end, because it was just too awkward how it coupled relatively disconnected elements together - such plugins would be sensitive to unrelated API changes.So the preferred approach, which I have nothing more than conjecture on right now, is something more like this - we put a 'plugins' field on
{versioncontrol_repositories}, which contains a serialized array of (ctools) plugin names that sit in particular slots (at least one for 'user auth', and one for 'user mapping' - or something like that). OnVersioncontrolRepository::build(), we instantiate those plugins, and then add methods on the class itself which just delegate to the plugin. I'm gonna post to each of the sub-issues talking about what I think those plugins should look like, how they should work.Note that if we end up deciding that other classes besides
VersioncontrolRepository, that's fine - we can follow the same pattern for those classes, and just add something toVersioncontrolEntity::build.Comment #15
marvil07 commentedComment #16
marvil07 commentedUpdating title to actually refer its nature.
This is tracking versioncontrol account refactor tag IIRC.
For now the major thing left is #983926: Remove account class, that is too related with #879704: Kill the account status module completely (it is really probable that we stay with it but modified to use auth plugins).
The other point left is #970244: Create a views handler to map operation author/committer to their drupal user.
When that is done this meta issue should be closed.
Comment #17
eliza411 commentedTagging for Git Sprint 7.
Comment #18
sdboyer commentedThe issues mentioned in #16 are closed out, and we're officially done with account-related stuff (and this meta-issue) until probably after phase 2 finishes and we have a stable vcapi release.