Skip to content

Instantly share code, notes, and snippets.

@tdhsmith
Last active February 10, 2016 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdhsmith/ec328a3db37ffe4718bd to your computer and use it in GitHub Desktop.
Save tdhsmith/ec328a3db37ffe4718bd to your computer and use it in GitHub Desktop.
Simplified flow for default user model interactions in JWTAuth
# http://www.graphviz.org/content/cluster
digraph G {
rankdir = LR;
splines = line;
subgraph cluster_package {
subgraph cluster_0 {
color=blue;
node [style=filled];
label = "JWT";
subgraph cluster_1 {
rank=same;
color=purple;
node [style=filled];
label = "JWTAuth";
toUser -> authenticate [constraint=false];
attempt;
}
fromUser;
}
subgraph cluster_2 {
node [style=filled];
label = "Auth provider\n(Illuminate)";
color=red;
byId;
byCredentials;
}
subgraph cluster_5 {
node [style=filled];
label = "JWTSubject";
color=teal;
subgraph cluster_8 {
node [style=filled];
label = "User";
style= dashed;
color=teal;
getJWTIdentifier;
}
}
style=dotted;
label="jwt-auth library";
}
subgraph cluster_3 {
node [style=filled];
label = "Guard contract\n(SessionGuard)";
color=orange;
onceUsingId;
once -> "attempt " -> hasValidCredentials [constraint=false];
};
subgraph cluster_4 {
node [style=filled];
label = "User provider\n(EloquentUserProvider)";
color=green;
retrieveById;
retrieveByCredentials;
validateCredentials;
}
subgraph cluster_6 {
node [style=filled];
label = "Model queries\n(QueryBuilder)";
color=gray;
find -> where [constraint=false];
}
subgraph cluster_7 {
node [style=filled];
label = "Hasher";
color=gray;
check;
}
START [shape=diamond];
START -> toUser;
START -> fromUser -> getJWTIdentifier;
START -> authenticate -> byId;
byId -> onceUsingId [constraint=false];
onceUsingId -> retrieveById -> find;
START -> attempt -> byCredentials;
byCredentials -> once [constraint=false];
getJWTIdentifier -> onceUsingId [style=invis];
"attempt " -> retrieveByCredentials -> where;
hasValidCredentials -> validateCredentials -> check;
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment