[ENH]: MCHttpRepository Authentication (Issue 6449)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[ENH]: MCHttpRepository Authentication (Issue 6449)

Sean P. DeNigris
Administrator
http://code.google.com/p/pharo/issues/detail?id=6449

We should be able to say, "MCHttpRepository logInto: serverUrl as: username withPassword: passwordString"

Is there any use case for not using the server credentials with a particular repo i.e. myserver/ss has credentials, but myserver/ss/myrepo uses different/no credentials? If we assume that all repos with a given prefix will use the same credentials, the implementation will be much simpler...

Conversation-starter in the inbox. Please take a look and comment, but do not integrate.

Name: SLICE-Issue-6449-ENH-MCHttpRepository-Authentication-SeanDeNigris.1
Hack together an implementation to start the conversation. ***This should NOT be integrated***
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [ENH]: MCHttpRepository Authentication (Issue 6449)

Sean P. DeNigris
Administrator
Fix in inbox. You specify the credentials to be used for a url and all new instances of MCHttpRepository will use those credentials. For example:

registry := MCServerRegistry uniqueInstance.
registry on: self exampleServerUrl beUser: 'myusername' withPassword: 'mypassword'.
               
repo := MCHttpRepository location: self exampleServerUrl.
               
repo user = 'myusername'.
repo password = 'mypassword'.

Full details:
* Add MCServerRegistry, a singleton which stores credentials for MCHttpRepository locations (see #on:beUser:withPassword:)
* Add MCHttpRepository class>>location:, which uses any stored credentials, or empty user and password if none
        -Change all senders manually setting empty credentials to use #location. e.g.
        MCHttpRepository
                location: 'http://ss3.gemstone.com/ss/Pharo20'
                user: ''
                password: ''
        or worse
        MCHttpRepository new
          location: self inboxRepositoryUrlString;
                user: '';
                password: ''
        becomes:
        MCHttpRepository location: 'http://ss3.gemstone.com/ss/Pharo20'.
* Fix Gofer repo authentication
        - Replace switch statement with polymorphic delegation
        - Setting credentials only effects the repo for that Gofer instance; does not change the stored credentials
* Tests - added for new behavior, fixed relevant existing; all passing
* MCHttpRepository class>>location:user:password: only effects that repo; does not change the stored credentials
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [ENH]: MCHttpRepository Authentication (Issue 6449)

Sean P. DeNigris
Administrator
This enhancement allows you to save MC repo credentials per url. That could mean, for example, one general login for ss3 and specific ones for specific projects on ss3. The credentials can be set in your startup script and will be applied to all new instances (unless you specifically override them). You will no longer have to re-execute a script every time a new repo is added.

See MCRepositoryAuthorizationTest for some examples. #testStoredCredentialsUsesMostSpecific is pretty comprehensive

I'd love for someone to review this slice asap. I've already made a few because it touches a bunch of kernel packages and the slices keep going stale.

Sean P. DeNigris wrote
Fix in inbox. You specify the credentials to be used for a url and all new instances of MCHttpRepository will use those credentials. For example:

registry := MCServerRegistry uniqueInstance.
registry on: self exampleServerUrl beUser: 'myusername' withPassword: 'mypassword'.
               
repo := MCHttpRepository location: self exampleServerUrl.
               
repo user = 'myusername'.
repo password = 'mypassword'.

Full details:
* Add MCServerRegistry, a singleton which stores credentials for MCHttpRepository locations (see #on:beUser:withPassword:)
* Add MCHttpRepository class>>location:, which uses any stored credentials, or empty user and password if none
        -Change all senders manually setting empty credentials to use #location. e.g.
        MCHttpRepository
                location: 'http://ss3.gemstone.com/ss/Pharo20'
                user: ''
                password: ''
        or worse
        MCHttpRepository new
          location: self inboxRepositoryUrlString;
                user: '';
                password: ''
        becomes:
        MCHttpRepository location: 'http://ss3.gemstone.com/ss/Pharo20'.
* Fix Gofer repo authentication
        - Replace switch statement with polymorphic delegation
        - Setting credentials only effects the repo for that Gofer instance; does not change the stored credentials
* Tests - added for new behavior, fixed relevant existing; all passing
* MCHttpRepository class>>location:user:password: only effects that repo; does not change the stored credentials
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [ENH]: MCHttpRepository Authentication (Issue 6449)

Sean P. DeNigris
Administrator
Sean P. DeNigris wrote
I'd love for someone to review this slice asap
Bump... two people have reviewed this. Are we ready to integrate? I would say so since it was being integrated previously but needed a new slice...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [ENH]: MCHttpRepository Authentication (Issue 6449)

Stéphane Ducasse
>> I'd love for someone to review this slice asap
>
> Bump... two people have reviewed this. Are we ready to integrate? I would
> say so since it was being integrated previously but needed a new slice…

Hi sean

Yes I would like. I was fixing the obvious bugs that were leading to vm crashing and were getting in our way to do simple actions.
Now I'm getting down a wave of tireness so I'm waiting for the wave to go up. :)

Stef