@Test(dataProvider = "auth-sas-tokens") void testAuthSasNonSufficientParametersSvSe(boolean expected, String credential){ AzureBlobHttpApiModule module = new AzureBlobHttpApiModule(); Credentials creds = new Credentials("identity", credential); assertEquals(module.authSAS(Suppliers.ofInstance(creds)), expected); }
@Named("sasAuth") @Provides protected boolean authSAS(@org.jclouds.location.Provider Supplier<Credentials> creds) { String credential = creds.get().credential; String formattedCredential = credential.startsWith("?") ? credential.substring(1) : credential; List<String> required = ImmutableList.of("sv", "sig"); try { Map<String, String> tokens = Splitter.on('&').withKeyValueSeparator('=').split(formattedCredential); return all(required, in(tokens.keySet())); } catch (Exception ex) { return false; } }
AzureBlobHttpApiModule extends HttpApiModule<AzureBlobClient> { @Named("sasAuth") @Provides protected boolean authSAS(@org.jclouds.location.Provider Supplier<Credentials> creds) { String credential = creds.get().credential; String formattedCredential = credential.startsWith("?") ? credential.substring(1) : credential; List<String> required = ImmutableList.of("sv", "sig"); try { Map<String, String> tokens = Splitter.on('&').withKeyValueSeparator('=').split(formattedCredential); return all(required, in(tokens.keySet())); } catch (Exception ex) { return false; } } }
AzureBlobHttpApiModule extends HttpApiModule<AzureBlobClient> { @Named("sasAuth") @Provides protected boolean authSAS(@org.jclouds.location.Provider Supplier<Credentials> creds) { String credential = creds.get().credential; String formattedCredential = credential.startsWith("?") ? credential.substring(1) : credential; List<String> required = ImmutableList.of("sv", "sig"); try { Map<String, String> tokens = Splitter.on('&').withKeyValueSeparator('=').split(formattedCredential); return all(required, in(tokens.keySet())); } catch (Exception ex) { return false; } }  }
AzureBlobHttpApiModule extends HttpApiModule<AzureBlobClient> { @Named("sasAuth") @Provides protected boolean authSAS(@org.jclouds.location.Provider Supplier<Credentials> creds) { String credential = creds.get().credential; String formattedCredential = credential.startsWith("?") ? credential.substring(1) : credential; List<String> required = ImmutableList.of("sv", "sig"); try { Map<String, String> tokens = Splitter.on('&').withKeyValueSeparator('=').split(formattedCredential); return all(required, in(tokens.keySet())); } catch (Exception ex) { return false; } }   }
AzureBlobHttpApiModule extends HttpApiModule<AzureBlobClient> { @Named("sasAuth") @Provides protected boolean authSAS(@org.jclouds.location.Provider Supplier<Credentials> creds) { String credential = creds.get().credential; String formattedCredential = credential.startsWith("?") ? credential.substring(1) : credential; List<String> required = ImmutableList.of("sv", "sig"); try { Map<String, String> tokens = Splitter.on('&').withKeyValueSeparator('=').split(formattedCredential); return all(required, in(tokens.keySet())); } catch (Exception ex) { return false; } }    }