nacx commented on this pull request.
> @@ -63,6 +64,17 @@ protected final String guiceProvideTimeStamp(@TimeStamp
> Supplier<String> cache)
protected String provideTimeStamp(@TimeStamp Supplier<String> cache) {
return cache.get();
}
+
+ /**
+ * checks which Authentication type is used
+ *
+ */
+ @Named("sasAuth")
+ @Provides
+ protected Boolean authSAS(@org.jclouds.location.Provider
Supplier<Credentials> creds) {
+ String credential = creds.get().credential;
+ return credential.matches("sv.*se.*sig.*");
With this regexp, for example, tokens where the `se` token comes before the
`sv` one won't match, and those are valid tokens, right?
I'd suggest you start writing a bunch of unit tests with several (many)
different combinations of valid and invalid SAS tokens, then build a regexp
that properly honors the contract defined by the tests.
--
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_r256277407