|
15 | 15 | import javax.crypto.spec.SecretKeySpec; |
16 | 16 | import java.lang.reflect.Constructor; |
17 | 17 | import java.lang.reflect.Method; |
18 | | -import java.net.URLEncoder; |
19 | 18 | import java.nio.ByteBuffer; |
20 | 19 | import java.nio.charset.StandardCharsets; |
21 | 20 | import java.security.*; |
@@ -126,79 +125,6 @@ public Operator(String host, String name, Type type) { |
126 | 125 | this(host, null, name, type); |
127 | 126 | } |
128 | 127 |
|
129 | | - public JsonNode v0TokenGenerate(String type, String identity) throws Exception { |
130 | | - String response = HttpClient.get(getBaseUrl() + "/token/generate?" + type + "=" + URLEncoder.encode(identity, StandardCharsets.UTF_8), CLIENT_API_KEY); |
131 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
132 | | - } |
133 | | - |
134 | | - public JsonNode v0TokenRefresh(String token) throws Exception { |
135 | | - String response = HttpClient.get(getBaseUrl() + "/token/refresh?refresh_token=" + URLEncoder.encode(token, StandardCharsets.UTF_8), CLIENT_API_KEY); |
136 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
137 | | - } |
138 | | - |
139 | | - public JsonNode v0CheckedTokenRefresh(String token) { |
140 | | - try { |
141 | | - return v0TokenRefresh(token); |
142 | | - } catch (Exception e) { |
143 | | - return Mapper.OBJECT_MAPPER.createObjectNode(); |
144 | | - } |
145 | | - } |
146 | | - |
147 | | - public JsonNode v0TokenValidate(String type, String identity, String advertisingToken) throws Exception { |
148 | | - String response = HttpClient.get(getBaseUrl() + "/token/validate?" + type + "=" + URLEncoder.encode(identity, StandardCharsets.UTF_8) + "&token=" + URLEncoder.encode(advertisingToken, StandardCharsets.UTF_8), CLIENT_API_KEY); |
149 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
150 | | - } |
151 | | - |
152 | | - public String v0TokenLogout(String type, String identity) throws Exception { |
153 | | - return HttpClient.get(getBaseUrl() + "/token/logout?" + type + "=" + URLEncoder.encode(identity, StandardCharsets.UTF_8), CLIENT_API_KEY); |
154 | | - } |
155 | | - |
156 | | - public String v0IdentityMap(String type, String identity) throws Exception { |
157 | | - return HttpClient.get(getBaseUrl() + "/identity/map?" + type + "=" + URLEncoder.encode(identity, StandardCharsets.UTF_8), CLIENT_API_KEY); |
158 | | - } |
159 | | - |
160 | | - public String v0StaticJsUid2Sdk() throws Exception { |
161 | | - return HttpClient.get(getBaseUrl() + "/static/js/uid2-sdk-2.0.0.js", CLIENT_API_KEY); |
162 | | - } |
163 | | - |
164 | | - public JsonNode v1TokenGenerate(String type, String identity) throws Exception { |
165 | | - String response = HttpClient.get(getBaseUrl() + "/v1/token/generate?" + type + "=" + URLEncoder.encode(identity, StandardCharsets.UTF_8), CLIENT_API_KEY); |
166 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
167 | | - } |
168 | | - |
169 | | - public JsonNode v1TokenRefresh(String token) throws Exception { |
170 | | - String response = HttpClient.get(getBaseUrl() + "/v1/token/refresh?refresh_token=" + URLEncoder.encode(token, StandardCharsets.UTF_8), CLIENT_API_KEY); |
171 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
172 | | - } |
173 | | - |
174 | | - public JsonNode v1CheckedTokenRefresh(String token) { |
175 | | - try { |
176 | | - return v1TokenRefresh(token); |
177 | | - } catch (Exception e) { |
178 | | - return Mapper.OBJECT_MAPPER.createObjectNode(); |
179 | | - } |
180 | | - } |
181 | | - |
182 | | - public JsonNode v1TokenValidate(String type, String identity, String advertisingToken) throws Exception { |
183 | | - String response = HttpClient.get(getBaseUrl() + "/v1/token/validate?" + type + "=" + URLEncoder.encode(identity, StandardCharsets.UTF_8) + "&token=" + URLEncoder.encode(advertisingToken, StandardCharsets.UTF_8), CLIENT_API_KEY); |
184 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
185 | | - } |
186 | | - |
187 | | - public JsonNode v1IdentityMap(String type, String identity) throws Exception { |
188 | | - String response = HttpClient.get(getBaseUrl() + "/v1/identity/map?" + type + "=" + URLEncoder.encode(identity, StandardCharsets.UTF_8), CLIENT_API_KEY); |
189 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
190 | | - } |
191 | | - |
192 | | - public JsonNode v1IdentityMapBatch(String payload) throws Exception { |
193 | | - String response = HttpClient.post(getBaseUrl() + "/v1/identity/map", payload, CLIENT_API_KEY); |
194 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
195 | | - } |
196 | | - |
197 | | - public JsonNode v1KeyLatest() throws Exception { |
198 | | - String response = HttpClient.get(getBaseUrl() + "/v1/key/latest", CLIENT_API_KEY); |
199 | | - return Mapper.OBJECT_MAPPER.readTree(response); |
200 | | - } |
201 | | - |
202 | 128 | public TokenGenerateResponse v2TokenGenerate(String type, String identity, boolean asOldParticipant) { |
203 | 129 | TokenGenerateInput token; |
204 | 130 |
|
|
0 commit comments