On Tue, Apr 16, 2013 at 6:13 PM, Dale Henrichs <dhenrich@vmware.com> wrote:
Mariano,

repositorOverrides: does apply to the entire load sequence, so it's not the best option for trying to simply keep your credentials private ...


OK.
�
The http repository does not expose user names and works just fine picking up the image based instance with credentials defined so I would expect the ftp repository to behave similarly.

+9999
�

If you want to keep the ftp user private the long term answer is submit a bug against the ftp repository implementation and ask that ftp repositories behave the same as http repositories with respect to credentials.

+1
�

Like I said before, I don't think that Metacello should be in the business of managing credentials and that includes adding features to Metacello whose sole purpose is to make up for a deficiencies elsewhere in the system ...

For the short term, you might just change the definition of MCFtpRepository>>description from:

� description
� � � � ^ 'ftp://', user, '@', host, '/', directory

to:

� description
� � � � ^ 'ftp://', host, '/', directory

and your username can be kept private ... I doesn't appear that description is used for anything other than display and comparison purposes ...


Yes, this is a very good idea.
I will open an issue in the bug tracker.
Anyone has an objection?

Cheers,

�
Dale

----- Original Message -----
| From: "Mariano Martinez Peck" <marianopeck@gmail.com>
| To: metacello@googlegroups.com
| Sent: Tuesday, April 16, 2013 12:35:18 PM
| Subject: Re: [Metacello] FTP repo without storing username/pass in ConfigurationOf
|
| On Tue, Apr 16, 2013 at 3:47 PM, Dale Henrichs <dhenrich@vmware.com> wrote:
|
| > Mariano,
| >
| > After closer inspection it turns out that for FTP repositories, you must
| > specify the username to uniquely identify the FTP url. If you specify the
| > username and leave the password empty in your Metacello spec, things should
| > work correctly ...
| >
| >
| Hi Dale,
|
| Thanks for the gory details, I understood :)
| Now I wonder...imagine I don't want to even include the username in the
| ConfigurationOf.... �shouldn't the repository override trick work?
| Something along the lines of:
|
| | repository |
| repository := MCFtpRepository
| � host: 'ftp.mydomain.com'
| �directory: 'myDirectory'
| �user: 'whatever'
| �password: 'whatelse'.
| version := (ConfigurationOfXX project version: 'xxx').
| version
| repositoryOverrides: Array with: repository.
| version load.
|
| just to be sure...#repositoryOverrides: does not propagate to transitive
| dependencies right?
|
| Thanks in advance,
|
|
|
|
|
| > Here are the gory details.
| >
| > There is code in Metacello that looks like the following:
| >
| > � description := aSpec description.
| > � (repo := repositories
| > � � detect: [:rep | rep description = description ]
| > � � ifNone: [ aSpec createRepository ]) ~~ nil
| > � � � ifTrue: [ repos add: repo ]
| >
| > where Metacello is attempting to determine if the repository has already
| > been created in the image. If the repository exists, then the in-image
| > credentials are used and you don't have to include user and password in the
| > Metacello repository spec.
| >
| > BTW, if you look at MCRepository>>= Metacello is basically using the same
| > algorithm.
| >
| > Now if you look at how MCHttpRepository behaves:
| >
| > � (MCHttpRepository
| > � � location: 'http://example.com'
| > � � user: 'foo'
| > � � password: 'bar') description.
| >
| > prints as:
| >
| > � 'http://example.com'
| >
| > Notice that the user is excluded from the description.
| >
| > Whereas for MCFtpRepository behaves differently:
| >
| > � (MCFtpRepository
| > � � host: 'ftp.mydomain.com'
| > � � directory: 'myDirectory'
| > � � user: 'whatever'
| > � � password: 'whatelse') description.
| >
| > prints as:
| >
| > � 'ftp://whatever@ftp.mydomain.com/myDirectory',
| >
| > Notice that the `user` is included in the description...
| >
| > So if you want an FTP repository to be considered #= to another FTP
| > repository you must specify the user name ...
| >
| > Let me know if this works for you.
| >
| > Dale
| >
| > ----- Original Message -----
| > | From: "Mariano Martinez Peck" <marianopeck@gmail.com>
| > | To: metacello@googlegroups.com
| > | Sent: Tuesday, April 16, 2013 7:55:50 AM
| > | Subject: Re: [Metacello] FTP repo without storing username/pass in
| > ConfigurationOf
| > |
| > | On Mon, Apr 15, 2013 at 10:14 PM, Dale Henrichs <dhenrich@vmware.com>
| > wrote:
| > |
| > | >
| > | >
| > | > |
| > | > |
| > | > | > and set the username/password there, then Metacello should honor
| > that
| > | > | > (like it does for the HTTP repository) ... so instead of adding
| > some
| > | > sort
| > | > | > of repository override to the load script, simply create the FTP
| > | > repository
| > | > | > with username/password inline in your load script.
| > | > | >
| > | > |
| > | > |
| > | > | Do you mean that I should declare my FTP repository like:
| > | > |
| > | > | MCFtpRepository
| > | > | � host: 'ftp.xxx.com'
| > | > | � directory: 'mc'
| > | > | � user: aUsername
| > | > | � password: aPassword
| > | > |
| > | > | and somehow register that repo in Monticello ? �so then when I load a
| > | > | ConfiguratioOfMyApp that has that repo it will honor the already set
| > up
| > | > | username/password?
| > | >
| > | > Yes. Metacello will use existing http/ftp/etc. repositories thus
| > | > inheriting the username and passwords set in the image. So if you
| > create
| > | > the ftp repository ahead of time (and specify a username and password)
| > | > everything should work smoothly (barring any bugs in Metacello:) ..
| > | >
| > | > I think it is a good idea to try to keep Metacello out of the
| > | > username/password business as much as possible:)
| > | >
| > | >
| > | Hi Dale, I tried that but it still didn't work. I get the following
| > error:
| > |
| > | [:response | (TelnetProtocolError protocolInstance: self)
| > | signal: response] in FTPClient(TelnetProtocolClient)>>lookForCode:
| > | Receiver: a FTPClient
| > | Arguments and temporary variables:
| > | code: 331
| > | response: '530 This is a private system - No anonymous login'
| > |
| > |
| > | In the baseline I have something like
| > |
| > | � � � � �spec repository: 'ftp://ftp.mydomain.com/myDirectory'.
| > |
| > |
| > | and before loading with metacello I do:
| > |
| > |
| > | repository := MCFtpRepository
| > | � host: 'ftp.mydomain.com'
| > | �directory: 'myDirectory'
| > | �user: 'whatever'
| > | �password: 'whatelse'.
| > |
| > | MCRepositoryGroup default addRepository: repository.
| > |
| > | And in fact, if I open MonticelloBrowser I do see my FTP repo with its
| > | correct username/pass...I can browse packages etc...
| > |
| > | So maybe I am not registering the package in the exact same collection
| > | Metacello is looking for? where does it look for the repo?
| > | how does it "honor" the already set up username/pass?
| > |
| > | Thanks!
| > |
| > |
| > |
| > |
| > | > Dale
| > | >
| > | > --
| > | > You received this message because you are subscribed to the Google
| > Groups
| > | > "Metacello" group.
| > | > To unsubscribe from this group and stop receiving emails from it, send
| > an
| > | > email to metacello+unsubscribe@googlegroups.com.
| > | > For more options, visit https://groups.google.com/groups/opt_out.
| > | >
| > | >
| > | >
| > |
| > |
| > | --
| > | Mariano
| > | http://marianopeck.wordpress.com
| > |
| > | --
| > | You received this message because you are subscribed to the Google Groups
| > | "Metacello" group.
| > | To unsubscribe from this group and stop receiving emails from it, send an
| > | email to metacello+unsubscribe@googlegroups.com.
| > | For more options, visit https://groups.google.com/groups/opt_out.
| > |
| > |
| > |
| >
| > --
| > You received this message because you are subscribed to the Google Groups
| > "Metacello" group.
| > To unsubscribe from this group and stop receiving emails from it, send an
| > email to metacello+unsubscribe@googlegroups.com.
| > For more options, visit https://groups.google.com/groups/opt_out.
| >
| >
| >
|
|
| --
| Mariano
| http://marianopeck.wordpress.com
|
| --
| You received this message because you are subscribed to the Google Groups
| "Metacello" group.
| To unsubscribe from this group and stop receiving emails from it, send an
| email to metacello+unsubscribe@googlegroups.com.
| For more options, visit https://groups.google.com/groups/opt_out.
|
|
|

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metacello+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Mariano
http://marianopeck.wordpress.com