Skip to content

Commit

Permalink
Merge pull request #71 from hmrc/APIS-3710
Browse files Browse the repository at this point in the history
APIS-3710 - update auth docs, plus a load of cosmetic changes along the way
  • Loading branch information
FluentSynergyDW authored Nov 23, 2018
2 parents cf307ad + c9f20ce commit 37509d7
Show file tree
Hide file tree
Showing 12 changed files with 421 additions and 470 deletions.
11 changes: 1 addition & 10 deletions app/assets/css/ad-hoc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@



// APIS-1076 - Temporary vertical alignment for Sandbox tables.
.sandbox-data {
td {
vertical-align: top
}
}



// APIS-1079 - Add margin to bottom of bullets.
.bullets + p {
margin-top: 1.2em;
Expand Down Expand Up @@ -120,7 +111,7 @@ tbody {
vertical-align: top;
}
td {
vertical-align: baseline;
vertical-align: top;
}

pre, code {
Expand Down
42 changes: 11 additions & 31 deletions app/uk/gov/hmrc/apidocumentation/views/authorisation.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,17 @@

@apiMain(pageAttributes) {

<h1 class="heading-xlarge">Authorisation</h1>
<h1 class="heading-xlarge">Authorisation</h1>

<nav role="navigation" aria-labelledby="onThisPage">
<h2 id="onThisPage" class="visually-hidden">on this page</h2>

<div class="grid-row">
<div class="column-one-half">
<ul class="list">
<li>
1. Introduction
</li>
<li>
2. <a href="@controllers.routes.DocumentationController.authorisationOpenAccessEndpointsPage().url">Open access endpoints</a>
</li>
<li>
3. <a href="@controllers.routes.DocumentationController.authorisationAppRestrictedEndpointsPage().url">Application-restricted endpoints</a>
</li>
</ul>
</div>

<div class="column-one-half">
<ul class="list">
<li>
4. <a href="@controllers.routes.DocumentationController.authorisationUserRestrictedEndpointsPage().url">User-restricted endpoints</a>
</li>
<li>
5. <a href="@controllers.routes.DocumentationController.authorisation2SVPage().url">2-step verification</a>
</li>
</ul>
</div>
</div>
<h2 id="onThisPage" class="visually-hidden">On this page</h2>
<ul class="list">
<li>Introduction</li>
<li><a href="@controllers.routes.DocumentationController.authorisationOpenAccessEndpointsPage().url">Open access endpoints</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisationAppRestrictedEndpointsPage().url">Application-restricted endpoints</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisationUserRestrictedEndpointsPage().url">User-restricted endpoints</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisation2SVPage().url">2-step verification</a></li>
</ul>
</nav>

<hr aria-hidden="true">
Expand Down Expand Up @@ -90,11 +70,11 @@ <h2 class="heading-large">Introduction</h2>
</tr>
<tr>
<td scope="row">Application-restricted</td>
<td><span class="code--slim">server_token</span></td>
<td><code class="code--slim">server_token</code></td>
</tr>
<tr>
<td scope="row">User-restricted</td>
<td>OAuth 2.0 <span class="code--slim">access_token</span></td>
<td>OAuth 2.0 <code class="code--slim">access_token</code></td>
</tr>
</tbody>
</table>
Expand Down
36 changes: 8 additions & 28 deletions app/uk/gov/hmrc/apidocumentation/views/authorisation2SV.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,14 @@
<h1 class="heading-xlarge">Authorisation</h1>

<nav role="navigation" aria-labelledby="onThisPage">
<h2 id="onThisPage" class="visually-hidden">on this page</h2>

<div class="grid-row">
<div class="column-one-half">
<ul class="list">
<li>
1. <a href="@controllers.routes.DocumentationController.authorisationPage().url">Introduction</a>
</li>
<li>
2. <a href="@controllers.routes.DocumentationController.authorisationOpenAccessEndpointsPage().url">Open access endpoints</a>
</li>
<li>
3. <a href="@controllers.routes.DocumentationController.authorisationAppRestrictedEndpointsPage().url">Application-restricted endpoints</a>
</li>
</ul>
</div>

<div class="column-one-half">
<ul class="list">
<li>
4. <a href="@controllers.routes.DocumentationController.authorisationUserRestrictedEndpointsPage().url">User-restricted endpoints</a>
</li>
<li>
5. 2-step verification
</li>
</ul>
</div>
</div>
<h2 id="onThisPage" class="visually-hidden">On this page</h2>
<ul class="list">
<li><a href="@controllers.routes.DocumentationController.authorisationPage().url">Introduction</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisationOpenAccessEndpointsPage().url">Open access endpoints</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisationAppRestrictedEndpointsPage().url">Application-restricted endpoints</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisationUserRestrictedEndpointsPage().url">User-restricted endpoints</a></li>
<li>2-step verification</li>
</ul>
</nav>

<hr aria-hidden="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,17 @@

@apiMain(pageAttributes) {

<h1 class="heading-xlarge">Authorisation</h1>
<h1 class="heading-xlarge">Authorisation</h1>

<nav role="navigation" aria-labelledby="onThisPage">
<h2 id="onThisPage" class="visually-hidden">on this page</h2>

<div class="grid-row">
<div class="column-one-half">
<ul class="list">
<li>
1. <a href="@controllers.routes.DocumentationController.authorisationPage().url">Introduction</a>
</li>
<li>
2. <a href="@controllers.routes.DocumentationController.authorisationOpenAccessEndpointsPage().url">Open access endpoints</a>
</li>
<li>
3. Application-restricted endpoints
</li>
</ul>
</div>

<div class="column-one-half">
<ul class="list">
<li>
4. <a href="@controllers.routes.DocumentationController.authorisationUserRestrictedEndpointsPage().url">User-restricted endpoints</a>
</li>
<li>
5. <a href="@controllers.routes.DocumentationController.authorisation2SVPage().url">2-step verification</a>
</li>
</ul>
</div>
</div>
<h2 id="onThisPage" class="visually-hidden">On this page</h2>
<ul class="list">
<li><a href="@controllers.routes.DocumentationController.authorisationPage().url">Introduction</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisationOpenAccessEndpointsPage().url">Open access endpoints</a></li>
<li>Application-restricted endpoints</li>
<li><a href="@controllers.routes.DocumentationController.authorisationUserRestrictedEndpointsPage().url">User-restricted endpoints</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisation2SVPage().url">2-step verification</a></li>
</ul>
</nav>

<hr aria-hidden="true">
Expand All @@ -68,15 +48,15 @@ <h2 class="heading-large">Application-restricted endpoints</h2>

<h3 class="heading-medium">Example</h3>

<pre class="snippet--block">
<pre class="code--block">
curl -H 'Authorization: Bearer [YOUR-SERVER-TOKEN]' \
-H 'Accept: application/vnd.hmrc.1.0+json' \
@{applicationConfig.productionApiBaseUrl}/hello/application'</pre>
@{applicationConfig.sandboxApiBaseUrl}/hello/application</pre>

<p>If you’ve already been issued a valid OAuth 2.0 <code class="code--slim">access_token</code>,
you can substitute this with a <code class="code--slim">server_token</code>.</p>

<p class="panel panel-border-wide">For a working example <a href="@controllers.routes.DocumentationController.tutorialsPage().url#app-restricted">see the application-restricted endpoint tutorial.</a></p>
<p class="panel panel-border-wide">For a working example, see the <a href="@controllers.routes.DocumentationController.tutorialsPage().url#app-restricted">application-restricted endpoint tutorial.</a></p>

</section>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,19 @@

@apiMain(pageAttributes) {

<h1 class="heading-xlarge">Authorisation</h1>
<h1 class="heading-xlarge">Authorisation</h1>

<nav role="navigation" aria-labelledby="onThisPage">
<h2 id="onThisPage" class="visually-hidden">on this page</h2>

<div class="grid-row">
<div class="column-one-half">
<ul class="list">
<li>
1. <a href="@controllers.routes.DocumentationController.authorisationPage().url">Introduction</a>
</li>
<li>
2. Open access endpoints
</li>
<li>
3. <a href="@controllers.routes.DocumentationController.authorisationAppRestrictedEndpointsPage().url">Application-restricted endpoints</a>
</li>
</ul>
</div>
<div class="column-one-half">
<ul class="list">
<li>
4. <a href="@controllers.routes.DocumentationController.authorisationUserRestrictedEndpointsPage().url">User-restricted endpoints</a>
</li>
<li>
5. <a href="@controllers.routes.DocumentationController.authorisation2SVPage().url">2-step verification</a>
</li>
</ul>
</div>
</div>
<h2 id="onThisPage" class="visually-hidden">On this page</h2>
<ul class="list">
<li><a href="@controllers.routes.DocumentationController.authorisationPage().url">Introduction</a></li>
<li>Open access endpoints</li>
<li><a href="@controllers.routes.DocumentationController.authorisationAppRestrictedEndpointsPage().url">Application-restricted endpoints</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisationUserRestrictedEndpointsPage().url">User-restricted endpoints</a></li>
<li><a href="@controllers.routes.DocumentationController.authorisation2SVPage().url">2-step verification</a></li>
</ul>
</nav>

<hr aria-hidden="true">

<section id="open-access">
Expand All @@ -66,12 +47,12 @@ <h2 class="heading-large">Open access endpoints</h2>

<h3>Example</h3>

<pre class="snippet--block">
curl -H 'Content-Type: application/vnd.hmrc.v1+json' \
@{applicationConfig.productionApiBaseUrl}/hello/world
<pre class="code--block">
curl -H 'Accept: application/vnd.hmrc.1.0+json' \
@{applicationConfig.sandboxApiBaseUrl}/hello/world
</pre>

<p class="panel panel-border-wide">For a working example <a href="@controllers.routes.DocumentationController.tutorialsPage().url#open-endpoint">see the open access endpoint tutorial</a>.</p>
<p class="panel panel-border-wide">For a working example, see the <a href="@controllers.routes.DocumentationController.tutorialsPage().url#open-endpoint">open access endpoint tutorial</a>.</p>


</section>
Expand Down
Loading

0 comments on commit 37509d7

Please sign in to comment.