> + * > + * @see <a href= "http://en.wikipedia.org/wiki/Basic_access_authentication" > /> > + */ > +@Singleton > +public class ServiceKeyAuthentication implements HttpRequestFilter { > + private final Supplier<Credentials> creds; > + > + @Inject > + public ServiceKeyAuthentication(@Provider Supplier<Credentials> creds) { > + this.creds = checkNotNull(creds, "creds"); > + } > + > + @Override > + public HttpRequest filter(HttpRequest request) throws HttpException { > + Credentials currentCreds = checkNotNull(creds.get(), "credential > supplier returned null"); > + if (currentCreds.identity == null || > currentCreds.identity.contains(":")) {
Why this ':' check? If only alphanumeric characters are allowed, wouldn't a regexp make more sense to validate the identity? --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/116/files#r21863271
