blob: 61e071a7fe3acdf7302a34e2902238012634b3df [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Apache Mesos: process::http::authentication::JWT Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Apache Mesos
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceprocess.html">process</a></li><li class="navelem"><a class="el" href="namespaceprocess_1_1http.html">http</a></li><li class="navelem"><a class="el" href="namespaceprocess_1_1http_1_1authentication.html">authentication</a></li><li class="navelem"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="classprocess_1_1http_1_1authentication_1_1JWT-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">process::http::authentication::JWT Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A <a class="el" href="namespaceJSON.html">JSON</a> Web Token (<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a>) implementation.
<a href="classprocess_1_1http_1_1authentication_1_1JWT.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="jwt_8hpp_source.html">jwt.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structprocess_1_1http_1_1authentication_1_1JWT_1_1Header.html">Header</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a40f175242221bec4b180ad2c586bb4bb"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a40f175242221bec4b180ad2c586bb4bb">Alg</a> { <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a40f175242221bec4b180ad2c586bb4bba6adf97f83acf6453d4a6a4b1070f3754">Alg::None</a>,
<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a40f175242221bec4b180ad2c586bb4bbaeb86be6fe0588de61c66e415b1e789a6">Alg::HS256</a>
}</td></tr>
<tr class="separator:a40f175242221bec4b180ad2c586bb4bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a8a366e6f7dc503be7865aecff0625e18"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classTry.html">Try</a>&lt; <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a>, <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWTError.html">JWTError</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a8a366e6f7dc503be7865aecff0625e18">parse</a> (const std::string &amp;token)</td></tr>
<tr class="memdesc:a8a366e6f7dc503be7865aecff0625e18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse an unsecured <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a>. <a href="#a8a366e6f7dc503be7865aecff0625e18">More...</a><br/></td></tr>
<tr class="separator:a8a366e6f7dc503be7865aecff0625e18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad43acd79d43e00d75f2e1f5c699d409e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classTry.html">Try</a>&lt; <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a>, <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWTError.html">JWTError</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#ad43acd79d43e00d75f2e1f5c699d409e">parse</a> (const std::string &amp;token, const std::string &amp;secret)</td></tr>
<tr class="memdesc:ad43acd79d43e00d75f2e1f5c699d409e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse a <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> and validate its HS256 signature. <a href="#ad43acd79d43e00d75f2e1f5c699d409e">More...</a><br/></td></tr>
<tr class="separator:ad43acd79d43e00d75f2e1f5c699d409e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad97d978e383dffd8f6c65c5cfd354837"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classTry.html">Try</a>&lt; <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a>, <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWTError.html">JWTError</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#ad97d978e383dffd8f6c65c5cfd354837">create</a> (const <a class="el" href="structJSON_1_1Object.html">JSON::Object</a> &amp;<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a6cef50dc4ce63043a7abf135ab17ce49">payload</a>)</td></tr>
<tr class="memdesc:ad97d978e383dffd8f6c65c5cfd354837"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an unsecured <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a>. <a href="#ad97d978e383dffd8f6c65c5cfd354837">More...</a><br/></td></tr>
<tr class="separator:ad97d978e383dffd8f6c65c5cfd354837"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49922f09d7295c2e15d05c70582b0cfb"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classTry.html">Try</a>&lt; <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a>, <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWTError.html">JWTError</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a49922f09d7295c2e15d05c70582b0cfb">create</a> (const <a class="el" href="structJSON_1_1Object.html">JSON::Object</a> &amp;<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a6cef50dc4ce63043a7abf135ab17ce49">payload</a>, const std::string &amp;secret)</td></tr>
<tr class="memdesc:a49922f09d7295c2e15d05c70582b0cfb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> with a HS256 signature. <a href="#a49922f09d7295c2e15d05c70582b0cfb">More...</a><br/></td></tr>
<tr class="separator:a49922f09d7295c2e15d05c70582b0cfb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a1a38ca588a67554ab7c4ca33d7862c3f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structprocess_1_1http_1_1authentication_1_1JWT_1_1Header.html">Header</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a1a38ca588a67554ab7c4ca33d7862c3f">header</a></td></tr>
<tr class="separator:a1a38ca588a67554ab7c4ca33d7862c3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6cef50dc4ce63043a7abf135ab17ce49"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structJSON_1_1Object.html">JSON::Object</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a6cef50dc4ce63043a7abf135ab17ce49">payload</a></td></tr>
<tr class="separator:a6cef50dc4ce63043a7abf135ab17ce49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a5314085fad497a929f9901cf55721a"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classOption.html">Option</a>&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a7a5314085fad497a929f9901cf55721a">signature</a></td></tr>
<tr class="separator:a7a5314085fad497a929f9901cf55721a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A <a class="el" href="namespaceJSON.html">JSON</a> Web Token (<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a>) implementation. </p>
<dl class="section see"><dt>See Also</dt><dd><a href="https://tools.ietf.org/html/rfc7519">RFC 7519</a></dd></dl>
<p>This implementation supports the 'none' and 'HS256' algorithms. <a class="el" href="structprocess_1_1http_1_1authentication_1_1JWT_1_1Header.html">Header</a> parameters other than 'alg' and 'typ' aren't parsed. To comply with RFC 7515, headers with 'crit' parameter are invalid. Currently, only the 'exp' standard claim is validated. Applications that need to validate other claims need to do this in their validation logic. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a40f175242221bec4b180ad2c586bb4bb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html#a40f175242221bec4b180ad2c586bb4bb">process::http::authentication::JWT::Alg</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a40f175242221bec4b180ad2c586bb4bba6adf97f83acf6453d4a6a4b1070f3754"></a>None</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a40f175242221bec4b180ad2c586bb4bbaeb86be6fe0588de61c66e415b1e789a6"></a>HS256</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ad97d978e383dffd8f6c65c5cfd354837"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classTry.html">Try</a>&lt;<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a>, <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWTError.html">JWTError</a>&gt; process::http::authentication::JWT::create </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structJSON_1_1Object.html">JSON::Object</a> &amp;&#160;</td>
<td class="paramname"><em>payload</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Create an unsecured <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">payload</td><td>The payload of the <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The unsecured <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> representation if successful otherwise an <a class="el" href="classError.html">Error</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="a49922f09d7295c2e15d05c70582b0cfb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classTry.html">Try</a>&lt;<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a>, <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWTError.html">JWTError</a>&gt; process::http::authentication::JWT::create </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structJSON_1_1Object.html">JSON::Object</a> &amp;&#160;</td>
<td class="paramname"><em>payload</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>secret</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> with a HS256 signature. </p>
<p>When creating a payload keep in mind that of the standard claims currently only 'exp' is validated during parsing.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">payload</td><td>The payload of the <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> </td></tr>
<tr><td class="paramname">secret</td><td>The secret to sign the <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> with.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The signed <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> representation if successful otherwise an <a class="el" href="classError.html">Error</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="a8a366e6f7dc503be7865aecff0625e18"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classTry.html">Try</a>&lt;<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a>, <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWTError.html">JWTError</a>&gt; process::http::authentication::JWT::parse </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>token</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Parse an unsecured <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">token</td><td>The <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> to parse.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> representation if successful otherwise an <a class="el" href="classError.html">Error</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="ad43acd79d43e00d75f2e1f5c699d409e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classTry.html">Try</a>&lt;<a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html">JWT</a>, <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWTError.html">JWTError</a>&gt; process::http::authentication::JWT::parse </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>token</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>secret</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Parse a <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> and validate its HS256 signature. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">token</td><td>The <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> to parse. </td></tr>
<tr><td class="paramname">secret</td><td>The secret to validate the signature with.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The validated <a class="el" href="classprocess_1_1http_1_1authentication_1_1JWT.html" title="A JSON Web Token (JWT) implementation. ">JWT</a> representation if successful otherwise an <a class="el" href="classError.html">Error</a>. </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a1a38ca588a67554ab7c4ca33d7862c3f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="structprocess_1_1http_1_1authentication_1_1JWT_1_1Header.html">Header</a> process::http::authentication::JWT::header</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a6cef50dc4ce63043a7abf135ab17ce49"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="structJSON_1_1Object.html">JSON::Object</a> process::http::authentication::JWT::payload</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a7a5314085fad497a929f9901cf55721a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classOption.html">Option</a>&lt;std::string&gt; process::http::authentication::JWT::signature</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>3rdparty/libprocess/include/process/<a class="el" href="jwt_8hpp_source.html">jwt.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>