> + * 
> + * @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(":")) {

So this is my ... sad ... attempt at making sure one does not pass in OpenStack 
like credentials (e.g. <some.project>:<some.username>). It was mainly to code 
against something I had found here, where we use OpenStack and Shipyard, in 
that we provide a higher level API on top of jclouds and found that some users, 
who were familiar with OpenStack, passed in the same identity format for 
shipyard. It should have been addressed in the higher level API but I did so 
here in my efforts to understand how jclouds works. I'll remove.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/116/files#r22216617

Reply via email to