So I've noticed that the "system" (ex: User.unknown()) accounts get passed 
through the resolver as well.

Right now I've added a chunk of code that ignores the system accounts using 
raw strings.

        if ("system".equals(id) || "unknown".equals(id) || 
"anonymous".equals(id) || "authenticated".equals(id)) {
            return idOrFullName; // skip all known system accounts
        }

I have done a very very quick search and haven't found any constants or 
anything else that would make that code better. Since this code is internal 
its really not a big deal, but I'm curious if anything exists.

Gavin

On Thursday, December 11, 2014 10:24:13 PM UTC-8, nicolas de loof wrote:
>
> context was design to help you resolve the user identity from another 
> source, for sample user claim to be "john" from svn repository 
> "svn://foo.bar" so you resolve him as "John Doe" on jenkins user database.
>
> .... but this info is actually harder than expected to extract from SCM, 
> so probably always empty :'(
>
> 2014-12-12 3:57 GMT+01:00 Gavin <[email protected] <javascript:>>:
>
>> Awesome. Those are essentially how I found out about the extension point 
>> in the first place.
>>
>> Is there any indication on what context might provide?
>>
>> Gavin
>>
>>
>> On Wednesday, December 10, 2014 11:20:19 PM UTC-8, Gavin wrote:
>>>
>>> Hey,
>>>
>>> I'm working on writing a new plugin to hook up jenkins to our internal 
>>> company authentication system. I've gotten the Security Realm working, but 
>>> I'm curious how exactly the User.CanonicalIdResolver stuff works.
>>>
>>> I'm trying to support mapping new users created by the git plugin to our 
>>> internal setup.
>>>
>>> So looking at 
>>> https://github.com/jenkinsci/git-plugin/blob/
>>> cb6f13a3e3158332f76a45e853b3766fe83d5828/src/main/java/
>>> hudson/plugins/git/GitChangeSet.java#L254
>>>
>>> I figure if I enable creating accounts based on email, then 
>>> User.CanonicalIdResolver's resolveCanonicalId method will pass in an email 
>>> or my normal username. Then I can do a lookup if the idOrFullName contains 
>>> a @ symbol (or a regex or something). 
>>>
>>> Is that the right use of this function? Will that prevent the creation 
>>> of the [email protected] <javascript:> accounts?
>>>
>>> Gavin
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/b45b758b-9810-4093-bfed-717a188c8f82%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/b45b758b-9810-4093-bfed-717a188c8f82%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/9296c847-8cc8-49c7-9e94-171577d3c398%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to