You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: client/src/main/java/org/asynchttpclient/oauth/OAuthSignatureCalculator.java
+79-88Lines changed: 79 additions & 88 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,15 @@
1
1
/*
2
-
* Copyright 2010 Ning, Inc.
2
+
* Copyright (c) 2016 AsyncHttpClient Project. All rights reserved.
3
3
*
4
-
* This program is licensed to you under the Apache License, version 2.0
5
-
* (the "License"); you may not use this file except in compliance with the
6
-
* License. You may obtain a copy of the License at:
7
-
*
8
-
* http://www.apache.org/licenses/LICENSE-2.0
9
-
*
10
-
* Unless required by applicable law or agreed to in writing, software
11
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
-
* License for the specific language governing permissions and limitations
14
-
* under the License.
4
+
* This program is licensed to you under the Apache License Version 2.0,
5
+
* and you may not use this file except in compliance with the Apache License Version 2.0.
6
+
* You may obtain a copy of the Apache License Version 2.0 at
7
+
* http://www.apache.org/licenses/LICENSE-2.0.
15
8
*
9
+
* Unless required by applicable law or agreed to in writing,
10
+
* software distributed under the Apache License Version 2.0 is distributed on an
11
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
16
13
*/
17
14
packageorg.asynchttpclient.oauth;
18
15
@@ -24,6 +21,7 @@
24
21
importjava.util.Arrays;
25
22
importjava.util.List;
26
23
importjava.util.concurrent.ThreadLocalRandom;
24
+
importjava.util.regex.Pattern;
27
25
28
26
importorg.asynchttpclient.Param;
29
27
importorg.asynchttpclient.Request;
@@ -35,12 +33,9 @@
35
33
importorg.asynchttpclient.util.Utf8UrlEncoder;
36
34
37
35
/**
38
-
* Simple OAuth signature calculator that can used for constructing client signatures
39
-
* for accessing services that use OAuth for authorization.
40
-
* <br>
41
-
* Supports most common signature inclusion and calculation methods: HMAC-SHA1 for
42
-
* calculation, and Header inclusion as inclusion method. Nonce generation uses
43
-
* simple random numbers with base64 encoding.
36
+
* Simple OAuth signature calculator that can used for constructing client signatures for accessing services that use OAuth for authorization. <br>
37
+
* Supports most common signature inclusion and calculation methods: HMAC-SHA1 for calculation, and Header inclusion as inclusion method. Nonce generation uses simple random
* Container for parameters used for calculating OAuth signature.
233
-
* About the only confusing aspect is that of whether entries are to be sorted
234
-
* before encoded or vice versa: if my reading is correct, encoding is to occur
235
-
* first, then sorting; although this should rarely matter (since sorting is primary
236
-
* by key, which usually has nothing to encode)... of course, rarely means that
237
-
* when it would occur it'd be harder to track down.
221
+
* Container for parameters used for calculating OAuth signature. About the only confusing aspect is that of whether entries are to be sorted before encoded or vice versa: if
222
+
* my reading is correct, encoding is to occur first, then sorting; although this should rarely matter (since sorting is primary by key, which usually has nothing to encode)...
223
+
* of course, rarely means that when it would occur it'd be harder to track down.
238
224
*/
239
225
finalstaticclassOAuthParameterSet {
240
226
privatefinalArrayList<Parameter> allParameters;
@@ -269,6 +255,7 @@ public String sortAndConcat() {
269
255
* Helper class for sorting query and form parameters that we need
0 commit comments