MCPcopy Index your code
hub / github.com/jgraph/drawio / createToken

Method createToken

src/main/java/com/mxgraph/online/AbsCache.java:236–254  ·  view source on GitHub ↗

@see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)

(String id, String secret)

Source from the content-addressed store, hash-verified

234 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
235 */
236 protected String createToken(String id, String secret)
237 throws UnauthorizedException
238 {
239 String key = createTokenKey(id, secret);
240
241 if (!cache.containsKey(key))
242 {
243 String token = Utils.generateToken(32);
244 cache.put(key, token);
245
246 debug("createToken key=" + key + " token=" + token);
247
248 return token;
249 }
250 else
251 {
252 throw new UnauthorizedException();
253 }
254 }
255
256 /**
257 * Removes the given patch if the secret does not match.

Callers 1

doGetAbstMethod · 0.95

Calls 5

createTokenKeyMethod · 0.95
generateTokenMethod · 0.95
debugMethod · 0.95
containsKeyMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected