Plant
Uses plantuml.com↗ to create svg
images from uml
source. Not included as a default viewer due to the external dependency, but it's great! See Implementation
Cors proxy see testing/Cors proxy
export const proxy = async (returnEndpoint) => {
const setup = (resolve, reject) => {
if (typeof lit === "undefined") reject("No lit");
else if (!window.__runkitCORSProxyEnpoint) {
(async (fn) => {
const rkEmbed = document.createElement("script");
rkEmbed.onload = async (fn) => {
const el = document.createElement("div");
document.body.appendChild(el);
el.setAttribute("style", "height:0;");
RunKit.createNotebook({
element: el,
mode: "endpoint",
onLoad: async (rk) => {
const endpoint = await rk.getEndpointURL();
window.__runkitCORSProxyEnpoint = endpoint;
document.body.removeChild(el);
},
evaluateOnLoad: true,
source: await lit.fs.readFile(
"/testing/runkit-express-cors-proxy.js",
{
encoding: "utf8",
}
),
});
};
rkEmbed.setAttribute("src", "https://embed.runkit.com");
document.body.appendChild(rkEmbed);
})();
} else {
resolve(window.__runkitCORSProxyEnpoint);
}
};
const endpoint = await new Promise(setup).then((e) => e);
if (false && !window.__runkitCORSProxyEnpoint) {
return "Still setting up proxy endpoint";
} else {
if (returnEndpoint) return endpoint;
const getAndReplaceDomain = (originalUrl, newDomain) => {
return newDomain + originalUrl.replace(/^https?:\/\//, "/");
};
const proxyFetch = async (url, opts = {}) => {
const proxyUrl = getAndReplaceDomain(url, endpoint);
return fetch(proxyUrl, opts);
};
return proxyFetch;
}
};
Examples:
class Dummy {
String data
void methods()
}
actor User
participant Service
participant "Third Party" as 3p
User -> Service : Uses
activate Service
Service -> User : Provides service
Service --> 3p : Leaks data
deactivate Service
participant User
User -> A: DoWork
activate A
A -> B: << createRequest >>
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: RequestCreated
deactivate B
A -> User: Done
deactivate A
participant participant as Foo
actor actor as Foo1
boundary boundary as Foo2
control control as Foo3
entity entity as Foo4
database database as Foo5
collections collections as Foo6
queue queue as Foo7
Foo -> Foo1 : To actor
Foo -> Foo2 : To boundary
Foo -> Foo3 : To control
Foo -> Foo4 : To entity
Foo -> Foo5 : To database
Foo -> Foo6 : To collections
Foo -> Foo7: To queue
start
if (condition A) then (yes)
:Text 1;
elseif (condition B) then (yes)
:Text 2;
stop
elseif (condition C) then (yes)
:Text 3;
elseif (condition D) then (yes)
:Text 4;
else (nothing)
:Text else;
endif
stop
Alice -> Bob: Authentication Request
Bob -> Alice: Authentication Failure
group My own label [My own label 2]
Alice -> Log : Log attack start
loop 1000 times
Alice -> Bob: DNS Attack
end
Alice -> Log : Log attack end
end