ak58588 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.*");
So, I did some investigation. sv token may appear at the beginning, in the
middle or at the end of the string, as well as any other token.
There are two types of SAS (Account and Service SAS), they both work with the
code.
There are optional tokens and required token. If we imagine their tokens as two
sets, there is an intersection, which is sv, se, st, sig and sp. But there are
many other tokens, which may or may not appear in Account or Service SAS. And
the position of the token doesn't matter at all. The only regex, I can now come
up with, is a very long one. Take a union of the both sets, and separate them
with OR operator.
There are also patterns - for example, after se there will always be a
timestamp. To make matters worse, the timestamp may also differ. And so on.
I would think of splitting the SAS String by '&' and then apply .match(regex).
But the regex would be a very long one.
What would you think of such an approach?
--
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_r256161493