Skip to content

Commit

Permalink
1.33.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Koleda committed Apr 15, 2019
1 parent 3fa0aa3 commit f0b9f9e
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 6 deletions.
17 changes: 17 additions & 0 deletions dist/OAuth2.gs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,17 @@ Service_.prototype.setIssuer = function(issuer) {
return this;
};

/**
* Sets additional JWT claims to use for Service Account authorization.
* @param {Object.<string,string>} additionalClaims The additional claims, as
* key-value pairs.
* @return {Service_} This service, for chaining.
*/
Service_.prototype.setAdditionalClaims = function(additionalClaims) {
this.additionalClaims_ = additionalClaims;
return this;
};

/**
* Sets the subject (sub) value to use for Service Account authorization.
* @param {string} subject This subject value
Expand Down Expand Up @@ -781,6 +792,12 @@ Service_.prototype.createJwt_ = function() {
if (this.params_.scope) {
claimSet.scope = this.params_.scope;
}
if (this.additionalClaims_) {
var additionalClaims = this.additionalClaims_;
Object.keys(additionalClaims).forEach(function(key) {
claimSet[key] = additionalClaims[key];
});
}
var toSign = Utilities.base64EncodeWebSafe(JSON.stringify(header)) + '.' +
Utilities.base64EncodeWebSafe(JSON.stringify(claimSet));
var signatureBytes =
Expand Down
155 changes: 154 additions & 1 deletion docs/Service_.html
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,159 @@ <h4 class="name" id="reset"><span class="type-signature"></span>reset<span class







<h4 class="name" id="setAdditionalClaims"><span class="type-signature"></span>setAdditionalClaims<span class="signature">(additionalClaims)</span><span class="type-signature"> &rarr; {<a href="Service_.html">Service_</a>}</span></h4>






<div class="description">
Sets additional JWT claims to use for Service Account authorization.
</div>









<h5>Parameters:</h5>


<table class="params">
<thead>
<tr>

<th>Name</th>


<th>Type</th>





<th class="last">Description</th>
</tr>
</thead>

<tbody>


<tr>

<td class="name"><code>additionalClaims</code></td>


<td class="type">


<span class="param-type">Object.&lt;string, string></span>



</td>





<td class="description last">The additional claims, as
key-value pairs.</td>
</tr>


</tbody>
</table>






<dl class="details">
































</dl>













<h5>Returns:</h5>


<div class="param-desc">
This service, for chaining.
</div>



<dl>
<dt>
Type
</dt>
<dd>

<span class="param-type"><a href="Service_.html">Service_</a></span>


</dd>
</dl>












Expand Down Expand Up @@ -4822,7 +4975,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Service_.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 08 2019 11:46:13 GMT-0500 (EST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 15 2019 13:06:16 GMT-0400 (EDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Storage_.html
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Service_.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 08 2019 11:46:13 GMT-0500 (EST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 15 2019 13:06:16 GMT-0400 (EDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Service_.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 08 2019 11:46:13 GMT-0500 (EST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 15 2019 13:06:16 GMT-0400 (EDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Service_.
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 08 2019 11:46:13 GMT-0500 (EST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 15 2019 13:06:16 GMT-0400 (EDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apps-script-oauth2",
"version": "1.32.0",
"version": "1.33.0",
"description": "OAuth2 for Apps Script is a library for Google Apps Script that provides the ability to create and authorize OAuth2 tokens as well as refresh them when they expire.",
"repository": {
"type": "git",
Expand Down

0 comments on commit f0b9f9e

Please sign in to comment.