TimothyJones/github-openid-wrapper

View on GitHub
docs/shim.svg

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"><svg xmlns="http://www.w3.org/2000/svg" width="837" height="960" xmlns:xlink="http://www.w3.org/1999/xlink"><source><![CDATA[Cognito->OpenID Shim: Authenticate\n(to get profile)
OpenID Shim->GitHub: Authenticate
Note right of GitHub: GitHub does authorisation\n here if necessary
GitHub->OpenID Shim: Authentication Code
OpenID Shim->Cognito: Authentication Code
Cognito-->OpenID Shim: Authentication Code
OpenID Shim-->GitHub: Authentication Code
GitHub-->OpenID Shim: Access Token
Note over OpenID Shim: also generates an ID token
OpenID Shim-->Cognito: Access and ID tokens
Cognito-->OpenID Shim: Request public key
Note right of OpenID Shim: Public key is used \nby cognito to validate\n the ID token
OpenID Shim-->Cognito: Public Key
Cognito-->OpenID Shim: Access token
Note over OpenID Shim, GitHub: Various API calls to\n get user profile data
OpenID Shim-->Cognito: User information
]]></source><desc></desc><defs><marker viewBox="0 0 5 5" markerWidth="5" markerHeight="5" orient="auto" refX="5" refY="2.5" id="markerArrowBlock"><path d="M 0 0 L 5 2.5 L 0 5 z"></path></marker><marker viewBox="0 0 9.6 16" markerWidth="4" markerHeight="16" orient="auto" refX="9.6" refY="8" id="markerArrowOpen"><path d="M 9.6,8 1.92,16 0,13.7 5.76,8 0,2.286 1.92,0 9.6,8 z"></path></marker></defs><g class="title"></g><g class="actor"><path d="M10,20C74.0,23.4 74.9,16.6 95.4,20.0C93.7,52.3 97.1,48.8 95.4,62.5C56.0,59.1 27.9,65.9 10.0,62.5C8.3,55.7 11.7,26.8 10.0,20.0" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="20" y="44" style="font-size: 16px; font-family: danielbd;"><tspan x="20">Cognito</tspan></text></g><g class="actor"><path d="M10,898.453125C23.7,901.9 30.5,895.0 95.4,898.5C93.7,912.3 97.1,905.3 95.4,941.0C30.5,937.5 74.9,944.4 10.0,941.0C11.7,915.4 8.3,913.4 10.0,898.5" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="20" y="922.453125" style="font-size: 16px; font-family: danielbd;"><tspan x="20">Cognito</tspan></text></g><path d="M52.7,62.5C86.1,273.6 19.2,241.3 52.7,898.5" stroke="#000000" fill="none" style="stroke-width: 2;"></path><g class="actor"><path d="M188.03125,20C288.3,14.6 209.6,25.4 323.0,20.0C321.3,40.0 324.7,52.3 323.0,62.5C229.7,67.9 234.2,57.1 188.0,62.5C186.3,47.4 189.7,30.3 188.0,20.0" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="198.03125" y="44" style="font-size: 16px; font-family: danielbd;"><tspan x="198.03125">OpenID Shim</tspan></text></g><g class="actor"><path d="M188.03125,898.453125C220.4,903.9 250.1,893.1 323.0,898.5C321.3,908.6 324.7,914.1 323.0,941.0C276.6,946.4 290.6,935.6 188.0,941.0C186.3,910.8 189.7,930.8 188.0,898.5" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="198.03125" y="922.453125" style="font-size: 16px; font-family: danielbd;"><tspan x="198.03125">OpenID Shim</tspan></text></g><path d="M255.5,62.5C288.9,764.7 222.1,581.5 255.5,898.5" stroke="#000000" fill="none" style="stroke-width: 2;"></path><g class="actor"><path d="M446.8828125,20C509.9,16.7 497.9,23.3 529.8,20.0C531.5,30.2 528.1,44.7 529.8,62.5C486.9,65.8 514.9,59.2 446.9,62.5C448.6,30.8 445.2,26.8 446.9,20.0" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="456.8828125" y="44" style="font-size: 16px; font-family: danielbd;"><tspan x="456.8828125">GitHub</tspan></text></g><g class="actor"><path d="M446.8828125,898.453125C466.8,901.8 509.9,895.1 529.8,898.5C531.5,924.4 528.1,919.7 529.8,941.0C466.8,944.3 461.8,937.6 446.9,941.0C448.6,916.4 445.2,922.5 446.9,898.5" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="456.8828125" y="922.453125" style="font-size: 16px; font-family: danielbd;"><tspan x="456.8828125">GitHub</tspan></text></g><path d="M488.3,62.5C454.9,206.4 521.8,486.5 488.3,898.5" stroke="#000000" fill="none" style="stroke-width: 2;"></path><g class="signal"><text x="90.1796875" y="80.65625" style="font-size: 16px; font-family: danielbd;"><tspan x="90.1796875">Authenticate</tspan><tspan dy="1.2em" x="90.1796875">(to get profile)</tspan></text><path d="M52.7,124.2C117.7,132.3 223.1,116.1 255.5,124.2" stroke="#000000" fill="none" style="stroke-width: 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="signal"><text x="318.5" y="151.9375" style="font-size: 16px; font-family: danielbd;"><tspan x="318.5">Authenticate</tspan></text><path d="M255.5,166.7C292.8,176.0 407.3,157.4 488.3,166.7" stroke="#000000" fill="none" style="stroke-width: 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="note"><path d="M508.34375,186.6875C707.7,177.2 550.0,196.2 745.7,186.7C747.7,229.6 743.6,200.3 745.7,238.4C594.4,247.9 707.7,228.9 508.3,238.4C506.3,198.7 510.4,199.5 508.3,186.7" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="513.34375" y="205.6875" style="font-size: 16px; font-family: danielbd;"><tspan x="513.34375">GitHub does authorisation</tspan><tspan dy="1.2em" x="513.34375">here if necessary</tspan></text></g><g class="signal"><text x="284.4453125" y="266.125" style="font-size: 16px; font-family: danielbd;"><tspan x="284.4453125">Authentication Code</tspan></text><path d="M488.3,280.9C315.4,290.2 337.2,271.6 255.5,280.9" stroke="#000000" fill="none" style="stroke-width: 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="signal"><text x="66.6171875" y="308.625" style="font-size: 16px; font-family: danielbd;"><tspan x="66.6171875">Authentication Code</tspan></text><path d="M255.5,323.4C210.7,331.5 155.3,315.3 52.7,323.4" stroke="#000000" fill="none" style="stroke-width: 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="signal"><text x="66.6171875" y="351.125" style="font-size: 16px; font-family: danielbd;"><tspan x="66.6171875">Authentication Code</tspan></text><path d="M52.7,365.9C223.1,357.8 95.2,374.0 255.5,365.9" stroke="#000000" fill="none" style="stroke-width: 2; stroke-dasharray: 6, 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="signal"><text x="284.4453125" y="393.625" style="font-size: 16px; font-family: danielbd;"><tspan x="284.4453125">Authentication Code</tspan></text><path d="M255.5,408.4C372.4,399.1 373.8,417.7 488.3,408.4" stroke="#000000" fill="none" style="stroke-width: 2; stroke-dasharray: 6, 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="signal"><text x="315.671875" y="436.125" style="font-size: 16px; font-family: danielbd;"><tspan x="315.671875">Access Token</tspan></text><path d="M488.3,450.9C356.5,441.6 292.8,460.2 255.5,450.9" stroke="#000000" fill="none" style="stroke-width: 2; stroke-dasharray: 6, 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="note"><path d="M138.421875,470.875C272.0,461.5 335.1,480.2 372.6,470.9C373.9,495.6 371.3,494.8 372.6,503.4C268.4,512.7 194.6,494.0 138.4,503.4C137.1,495.6 139.7,485.4 138.4,470.9" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="143.421875" y="489.875" style="font-size: 16px; font-family: danielbd;"><tspan x="143.421875">also generates an ID token</tspan></text></g><g class="signal"><text x="62.6875" y="531.125" style="font-size: 16px; font-family: danielbd;"><tspan x="62.6875">Access and ID tokens</tspan></text><path d="M255.5,545.9C194.4,554.0 223.1,537.8 52.7,545.9" stroke="#000000" fill="none" style="stroke-width: 2; stroke-dasharray: 6, 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="signal"><text x="73.6484375" y="573.625" style="font-size: 16px; font-family: danielbd;"><tspan x="73.6484375">Request public key</tspan></text><path d="M52.7,588.4C114.7,596.5 101.4,580.3 255.5,588.4" stroke="#000000" fill="none" style="stroke-width: 2; stroke-dasharray: 6, 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="note"><path d="M275.5,608.375C354.8,600.7 385.0,616.1 468.3,608.4C465.5,647.8 471.2,667.9 468.3,679.3C333.4,671.6 321.8,687.0 275.5,679.3C278.3,625.3 272.7,649.8 275.5,608.4" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="280.78125" y="627.375" style="font-size: 16px; font-family: danielbd;"><tspan x="280.5">Public key is used</tspan><tspan dy="1.2em" x="280.5">by cognito to validate</tspan><tspan dy="1.2em" x="280.5">the ID token</tspan></text></g><g class="signal"><text x="111" y="707.015625" style="font-size: 16px; font-family: danielbd;"><tspan x="111">Public Key</tspan></text><path d="M255.5,721.8C182.4,729.9 223.1,713.7 52.7,721.8" stroke="#000000" fill="none" style="stroke-width: 2; stroke-dasharray: 6, 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="signal"><text x="99.6875" y="749.515625" style="font-size: 16px; font-family: danielbd;"><tspan x="99.6875">Access token</tspan></text><path d="M52.7,764.3C85.1,772.4 179.3,756.2 255.5,764.3" stroke="#000000" fill="none" style="stroke-width: 2; stroke-dasharray: 6, 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g><g class="note"><path d="M245.5,784.265625C437.7,794.4 457.9,774.2 498.3,784.3C496.3,823.5 500.4,822.3 498.3,836.0C286.0,846.1 306.2,825.8 245.5,836.0C243.4,800.5 247.6,827.2 245.5,784.3" stroke="#000000" fill="#ffffff" style="stroke-width: 2;"></path><text x="254.5625" y="803.265625" style="font-size: 16px; font-family: danielbd;"><tspan x="250.5">Various API calls to</tspan><tspan dy="1.2em" x="250.5">get user profile data</tspan></text></g><g class="signal"><text x="79.46875" y="863.703125" style="font-size: 16px; font-family: danielbd;"><tspan x="79.46875">User information</tspan></text><path d="M255.5,878.5C206.7,870.3 101.4,886.6 52.7,878.5" stroke="#000000" fill="none" style="stroke-width: 2; stroke-dasharray: 6, 2; marker-end: url(&quot;#markerArrowBlock&quot;);"></path></g></svg>