jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aliaksandra Kharushka <notificati...@github.com>
Subject Re: [jclouds/jclouds] [JCLOUDS-1428] Support for SAS token based Authentication for Azure Blob Storage (#1270)
Date Tue, 05 Feb 2019 12:35:32 GMT
ak58588 commented on this pull request.



> +         request = filterSAS(request, this.credential);
+      } else {
+         request = filterKey(request);
+      }
+      utils.logRequest(signatureLog, request, "<<");
+      return request;
+   }
+   
+   /**
+   * 
+   * this method checks the length of the authentication string, and decides, which auth
method it represents. 
+   * 
+   */
+   public boolean authSAS(String credential){
+      int length = credential.length();
+      return  length < 150 && length > 120;    

with this new SASCredentials class, the code is compiled without any issue,  however, when
I run my test app, which performs some manipulations on blobs and containers I get a number
of errors from Guice: 
```
com.google.inject.CreationException: Guice creation errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Illegal character in authority
at index 8: https://${jclouds.identity}.blob.core.windows.net
  at org.jclouds.location.suppliers.fromconfig.ProviderURIFromProviderMetadata.<init>(ProviderURIFromProviderMetadata.java:31)
  at org.jclouds.location.suppliers.fromconfig.ProviderURIFromProviderMetadata.class(ProviderURIFromProviderMetadata.java:31)
  while locating org.jclouds.location.suppliers.fromconfig.ProviderURIFromProviderMetadata
  while locating org.jclouds.location.suppliers.ProviderURISupplier
  at org.jclouds.location.config.LocationModule.provideProvider(LocationModule.java:90)
  at org.jclouds.location.config.LocationModule.provideProvider(LocationModule.java:90)
  while locating com.google.common.base.Supplier<java.net.URI> annotated with @org.jclouds.location.Provider()
    for parameter 1 at org.jclouds.location.suppliers.fromconfig.RegionIdToURIFromConfigurationOrDefaultToProvider.<init>(RegionIdToURIFromConfigurationOrDefaultToProvider.java:44)
  at org.jclouds.location.suppliers.fromconfig.RegionIdToURIFromConfigurationOrDefaultToProvider.class(RegionIdToURIFromConfigurationOrDefaultToProvider.java:44)
  while locating org.jclouds.location.suppliers.fromconfig.RegionIdToURIFromConfigurationOrDefaultToProvider
  while locating org.jclouds.location.suppliers.RegionIdToURISupplier
  at org.jclouds.location.config.LocationModule.regionIdToURISupplier(LocationModule.java:158)
  at org.jclouds.location.config.LocationModule.regionIdToURISupplier(LocationModule.java:158)
  while locating com.google.common.base.Supplier<java.util.Map<java.lang.String, com.google.common.base.Supplier<java.net.URI>>>
annotated with @org.jclouds.location.Region()
    for parameter 0 at org.jclouds.location.suppliers.implicit.GetRegionIdMatchingProviderURIOrNull.<init>(GetRegionIdMatchingProviderURIOrNull.java:39)
  at org.jclouds.location.suppliers.implicit.GetRegionIdMatchingProviderURIOrNull.class(GetRegionIdMatchingProviderURIOrNull.java:39)
  while locating org.jclouds.location.suppliers.implicit.GetRegionIdMatchingProviderURIOrNull
  while locating org.jclouds.location.suppliers.ImplicitRegionIdSupplier
  at org.jclouds.location.config.LocationModule.implicitRegionIdSupplier(LocationModule.java:167)
  at org.jclouds.location.config.LocationModule.implicitRegionIdSupplier(LocationModule.java:167)
  while locating com.google.common.base.Supplier<java.lang.String> annotated with @org.jclouds.location.Region()
    for parameter 0 at org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstRegionOptionallyMatchingRegionId.<init>(OnlyLocationOrFirstRegionOptionallyMatchingRegionId.java:51)
  at org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstRegionOptionallyMatchingRegionId.class(OnlyLocationOrFirstRegionOptionallyMatchingRegionId.java:44)
  while locating org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstRegionOptionallyMatchingRegionId
  while locating org.jclouds.location.suppliers.ImplicitLocationSupplier
  at org.jclouds.location.config.LocationModule.implicitLocationSupplier(LocationModule.java:98)
  at org.jclouds.location.config.LocationModule.implicitLocationSupplier(LocationModule.java:98)
  while locating com.google.common.base.Supplier<org.jclouds.domain.Location>
Caused by: java.lang.IllegalArgumentException: Illegal character in authority at index 8:
https://${jclouds.identity}.blob.core.windows.net
	at java.net.URI.create(URI.java:852)
	at org.jclouds.rest.suppliers.URIFromStringSupplier.<init>(URIFromStringSupplier.java:37)
	at org.jclouds.location.suppliers.fromconfig.ProviderURIFromProviderMetadata.<init>(ProviderURIFromProviderMetadata.java:31)
	at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.google.inject.internal.DefaultConstructionProxyFactory$2.newInstance(DefaultConstructionProxyFactory.java:85)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:737)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
	at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
	at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:98)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:737)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
	at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
	at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:98)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:737)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
	at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
	at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:98)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:737)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
	at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
	at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:98)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:204)
	at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:198)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
	at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:198)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:179)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
	at com.google.inject.Guice.createInjector(Guice.java:95)
	at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:405)
	at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:328)
	at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:615)
	at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:595)

```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1270#discussion_r253845019
Mime
View raw message