Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

[DSL] Better support for authentication outside of URL #17

Open
ysb33r opened this issue Mar 29, 2014 · 0 comments
Open

[DSL] Better support for authentication outside of URL #17

ysb33r opened this issue Mar 29, 2014 · 0 comments

Comments

@ysb33r
Copy link
Owner

ysb33r commented Mar 29, 2014

The easiest way to perform suer auth is to encode the username & password in the URL. This is obvisouly not the best way for a nuber of reasons.

Currently in Apache VFS the way of creating a user authentication object is

StaticUserAuthenticator auth = new StaticUserAuthenticator("domain", "username", "password");
FileSystemOptions opts = new FileSystemOptions(); 
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth); 
FileObject fo = VFS.getManager().resolveFile("smb://host/anyshare/dir", opts);

Need a Groovy way of adding this to a fie system or a per-request execution.

Maybe something like

// In an options block 
options {
  ftp {
    auth {
      username : 'USERNAME'
      password : 'PASSWORD'
    }
 }
}

// As an auth object
def credentials = auth ( username : 'USERNAME', password : 'PASSWORD', domain :  'DOMAIN' )

// Using an auth object in a statement
// (But does the auth object apply to src or dest url?
cp 'ftp://from.server/a.file', 'file:///home/ysb33r/b.file', auth : credentials
@ysb33r ysb33r changed the title Better support for authentication outide of URL Better support for authentication outside of URL Apr 29, 2014
@ysb33r ysb33r changed the title Better support for authentication outside of URL [DSL] Better support for authentication outside of URL May 2, 2014
@ysb33r ysb33r added dsl labels Jul 3, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant