Skip to content

Commit

Permalink
Merge branch 'release/1.17.0' into poc/obligation-dates-table
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMBligh authored May 15, 2022
2 parents c8e1047 + e5d4fa7 commit 3be8470
Show file tree
Hide file tree
Showing 22 changed files with 712 additions and 43 deletions.
31 changes: 31 additions & 0 deletions slate/source/includes/endpoint-version-schedule/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,39 @@ These dates may be subject to change depending upon new or changed legislative a
| **Y24 #4** | 09/09/2024 | 0 |
| **Y24 #5** | 11/11/2024 | 0 |

<div id="date-picker">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Obligations @</span>
</div>
<input type="text" id="end-date" placeholder="End date" aria-label="End date" class="form-control end-date date-picker-input">
<div class="collapse-obligations-toggle">
<div class="toggle-title">Collapse obligations</div>
<!-- Rounded switch -->
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</div>
<div class="legend-title"><a href="#legend">Legend &#9432;</a></div>
</div>
<span class="cancel hide">×</span>
</div>
<div class="lightbox" id="legend"><a href="#" class="defocus"></a>
<div class="legend">
<div class="legend-title">Legend</div>
<ul>
<li><span class="legend-future-obligations"></span> <b>Future:</b> obligations that are due more than three months into the future.</li>
<li><span class="legend-emerging-obligations"></span> <b>Emerging:</b> obligations that are due within the next three months.</li>
<li><span class="legend-active-obligations"></span> <b>Active:</b> obligations that must currently be supported.</li>
<li><span class="legend-deprecated-obligations"></span> <b>Deprecated:</b> obligations that are being phased out and have entered into a deprecation phase before being retired.</li>
<li><span class="legend-retired-obligations"></span> <b>Retired:</b> obligations that have expired or are superceded and no longer need to be supported.</li>
</ul>
</div>
</div>

# Endpoint Version Schedule

The following tables describe the endpoint versions and the dates they become binding within the data standards.

**Binding Date** indicates the dates the particular version of an endpoint becomes binding in the data standards.
Expand Down
8 changes: 2 additions & 6 deletions slate/source/includes/introduction/_intro.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@

```diff
The Version Delta tab can be used to see in context changes between
this version of the standards and the immediately previous version
of the standards.
The Version Delta tab can be used to see in context changes between this version of the standards and the immediately previous version of the standards.

This text is an example of a new addition to the standards:
+ New text added here

This text is an example of text removed from the standards:
- Old text removed

Note: changes to request and response payloads are listed at the
beginning of the relevant API section due to the documentation
being auto generated from OpenAPI specification files.
Note: changes to request and response payloads are listed at the beginning of the relevant API section due to the documentation being auto generated from OpenAPI specification files.
```

These standards have been developed as part of the Australian Government's introduction of the [Consumer Data Right](https://www.accc.gov.au/focus-areas/consumer-data-right "ACCC Consumer Data Right webpage") legislation to give Australians greater control over their data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This release addresses the following change requests raised on [Standards Mainte

- [Standards Maintenance Issue 503: Fix documentation defect for CDR Arrangement JWT method](https://github.com/ConsumerDataStandardsAustralia/standards-maintenance/issues/503)
- [Standards Maintenance Issue 504: Correct Data Language for Contact Details (profile scope and individual claims)](https://github.com/ConsumerDataStandardsAustralia/standards-maintenance/issues/504)
- [Standards Maintenance Issue 482: JWT signing non-normative examples use unsupported signing algorithm)](https://github.com/ConsumerDataStandardsAustralia/standards-maintenance/issues/482)

### Decision Proposals

Expand All @@ -31,8 +32,9 @@ This release addresses the following Decision Proposals published on [Standards]

|Change|Description|Link|
|------|-----------|----|
| Obligation date highlighting | Highlighting based on a date pickers has been added for the Endpoint versioning schedule to enhance documentation functionality. This feature allows users to select a target date and determine what obligations apply at that date. | [Endpoint versioning schedule](../../includes/endpoint-version-schedule/)
| Obligation Dates Table | A series of fixed obligation milestones were agreed in Maintenance Iteration 10. This set of milestones will be used to pin breaking changes to a deterministic series of possible obligation dates. | [Obligation Dates]() |

| Scrollable diffs and examples | Added previous and next buttons to support easy scrolling between all diffs and non-normative examples. This feature is context dependent on the tab being viewed | N/A |

## API End Points

Expand All @@ -44,6 +46,8 @@ This release addresses the following Decision Proposals published on [Standards]

|Change|Description|Link|
|------|-----------|----|
| Self-signed JWT Client Authentication non-normative example | [**Standards Maintenance #482**](https://github.com/ConsumerDataStandardsAustralia/standards-maintenance/issues/482): Updated self-signed JWT client authentication non-normative example `alg` field from HS256 to PS256 | [Client Authentication](../../index.html#client-authentication) |
| CDR Arrangement Revocation End Point non-normative example | [**Standards Maintenance #482**](https://github.com/ConsumerDataStandardsAustralia/standards-maintenance/issues/482): Updated data recipient hosted CDR Arrangement Revocation End Point non-normative example `alg` field from HS256 to PS256 | [Security Endpoints](../../index.html#security-endpoints) |

## Consumer Experience

Expand Down
8 changes: 7 additions & 1 deletion slate/source/includes/security/_client_authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Authorization: Bearer eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjEyNDU2In0.ey
## Decoded Bearer token JWT
{
"alg":"HS256",
"alg":"PS256",
"typ":"JWT",
"kid":"12456"
}
Expand All @@ -93,6 +93,12 @@ Authorization: Bearer eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjEyNDU2In0.ey
}
```

```diff
Updated self-signed JWT client authentication non-normative example `alg` field from HS256 to PS256
```



Data Recipient Software Products and Data Holders supporting the self-signed JWT authentication of clients using a signed JWT **MUST** do so according to the following requirements:


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,19 @@ Authorization: Bearer eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjEyNDU2In0.ey
## Decoded cdr_arrangement_jwt JWT
{
"typ": "JWT",
"alg": "HS256",
"alg": "PS256",
"kid":"12456"
}
{
"cdr_arrangement_id": "5a1bf696-ee03-408b-b315-97955415d1f0"
}
```

```diff
Updated Data Recipient end point non-normative example `alg` field from HS256 to PS256
```


**Data Recipient hosted endpoint**

The location of the Data Recipient Software Product CDR Arrangement Revocation End Point is determined by the `RecipientBaseURI` provided by the Data Recipient Software Product in the client Software Statement Assertion (SSA).
Expand Down
2 changes: 2 additions & 0 deletions slate/source/javascripts/all_nosearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//= require ./app/_toc
//= require ./app/_lang
//= require ./app/_tooltips
//= require ./app/_datepicker
//= require ./app/_scroll

$(function() {
loadToc($('#toc'), '.toc-link', '.toc-list-h2', 10);
Expand Down
133 changes: 133 additions & 0 deletions slate/source/javascripts/app/_datepicker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
//= require ../lib/_jquery
//= require ../lib/_datepicker

;(function () {
'use strict';

$(init);

function highlight(endDate, $participantObligations) {

$participantObligations.each(function(index) {
if ( !isValidDate(endDate) ) {
$(this).removeClass();
} else {
var bindingDateString = $(this).find("td").eq(5).text();
var bindingDate = stringToDate(bindingDateString, 3,2,1);

var retirementDateString = $(this).find("td").eq(6).text()
var retirementDate = stringToDate(retirementDateString, 3,2,1);

//var deprecationDate = stringToDate($(this).find("td").eq(7).text(), 3,2,1);

var today = new Date();
var threeMonthsAgo = new Date(); threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);

// reset
var milestoneDate = isValidDate(endDate) ? endDate : today;
var decoration = "";
$(this).removeClass();

// determine obligation decoration
if (isValidDate(retirementDate) && (milestoneDate >= retirementDate) ) {
decoration = "retired-obligation";
} else if ( isValidDate(bindingDate) ) {
if ( milestoneDate >= bindingDate ) {
if (isValidDate(retirementDate) && milestoneDate < retirementDate) {
decoration = "deprecated-obligation";
} else {
decoration = "active-obligation";
}
} else if ( bindingDate <= threeMonthsAgo ) {
decoration = "emerging-obligation";
} else if ( milestoneDate < bindingDate ) {
decoration = "future-obligation";
} else {
decoration = "inactive-obligation";
}
}

$(this).addClass(decoration);

}
});
}

function isValidDate(dateObject) {
return !isNaN(dateObject.valueOf());
}

function isDate(dateString, dayPosition=1, monthPosition=2, yearPosition=3) {

var dateObject = stringToDate(dateString, dayPosition, monthPosition, yearPosition)

return isValidDate(dateObject);
}


function stringToDate(dateString, dayPosition=1, monthPosition=2, yearPosition=3) {
if (Math.min(dayPosition, monthPosition, yearPosition) != 1 ||
Math.max(dayPosition, monthPosition, yearPosition) != 3 ) { return new Date("NaN"); }

if (!dateString) { return new Date("NaN"); }

var dateParts = dateString.split(/(?:-|\/)+/);

if (dateParts.length != 3) { return new Date("NaN"); }

// month is 0-based, that's why we need dateParts[1] - 1
return new Date(+dateParts[yearPosition-1], dateParts[monthPosition-1] - 1, +dateParts[dayPosition-1].replace(/\*|†|‡/g, ""));
}

function eltToDate($dateObject) {
return isDate($dateObject.val()) ? $dateObject.datepicker('getDate') : new Date("NaN");
}


function init() {

$('.content table').addClass('obligations');
var $participantObligations = $('.obligations tr');
var $endDate = $('#end-date');

var options = {
autoHide: true,
language: 'en-GB',
format: 'dd/mm/yyyy'
}

$endDate.datepicker(options);


$endDate.on('change', function () {
var endDate = eltToDate($endDate);
if ( isValidDate(endDate) ) {
$("#date-picker").addClass("date-chosen");
$("#date-picker .cancel").removeClass("hide");
$("#date-picker .cancel").show();
} else {
$("#date-picker").removeClass("date-chosen");
$("#date-picker .cancel").addClass("hide");
$("#date-picker .cancel").hide();
}

highlight(endDate, $participantObligations);
});

$("#date-picker .cancel").on('click', function () {
$("#date-picker input").val('');
$("#date-picker").removeClass("date-chosen");
$("#date-picker .cancel").addClass("hide");
$("#date-picker .cancel").hide();
var endDate = eltToDate($endDate);
highlight(endDate, $participantObligations);
});

$(".collapse-obligations-toggle input").on('click', function () {
console.log(new Date().getTime()+": toggle");
$(".obligations").toggleClass('collapse-obligations');
});

}

})();
5 changes: 5 additions & 0 deletions slate/source/javascripts/app/_lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,13 @@ under the License.
}
}


// if we click on a language tab, activate that language
$(function() {
$("blockquote").each(function() {
$(this).addClass("tab-examples");
});

$(".lang-selector a").on("click", function() {
var language = $(this).data("language-name");
pushURL(language);
Expand Down
89 changes: 89 additions & 0 deletions slate/source/javascripts/app/_scroll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
;(function () {
'use strict';

$(init);

function scroll(classNames) {
var $allElements = {};
$.each(classNames, function(index, value) {
$allElements[value] = {'elts': $('.tab-'+value), 'last': 0 };
$allElements[value].last = $allElements[value].elts.length - 1;
});


$("#scroll-next").click(function () {
var minDistance = Number.MAX_SAFE_INTEGER;
var $nextElement = null;
var currentPosition = $(window).scrollTop();

var $activeTab = $($('.lang-selector').find('.active')[0] || $('.lang-selector').find('.tab-selector').first());
var tabKey = $activeTab.data('languageName');

if ($allElements[tabKey] !== undefined) {
var $elementList = $allElements[tabKey].elts;

$elementList.each(function(index) {

var delta = $(this).position().top - currentPosition - 40;

if (delta >= 0 && delta < minDistance) {
minDistance = delta;
$nextElement = $(this);
}
});

if (!$nextElement) { $nextElement = $($elementList[0]); }

if($nextElement.length) {
$('html, body').stop(true).animate({
scrollTop: ($nextElement.offset().top - 30)
}, 800);
}
}

return false;
});

$("#scroll-prev").click(function () {
var minDistance = Number.MAX_SAFE_INTEGER;
var $prevElement = null;
var currentPosition = $(window).scrollTop();
var lastIndex = 0;


var $activeTab = $($('.lang-selector').find('.active')[0] || $('.lang-selector').find('.tab-selector').first());
var tabKey = $activeTab.data('languageName');

if ($allElements[tabKey] !== undefined) {
var $elementList = $allElements[tabKey].elts;
lastIndex = $allElements[tabKey].last;

$elementList.each(function(index) {

var delta = currentPosition - 40 - $(this).position().top;

if (delta >= 0 && delta < minDistance) {
minDistance = delta;
$prevElement = $(this);
}
});

if (!$prevElement) { $prevElement = $($elementList[lastIndex]); }

if($prevElement.length) {
$('html, body').stop(true).animate({
scrollTop: ($prevElement.offset().top - 30)
}, 800);
}
}
return false;
});
}

function init() {

scroll(['examples', 'diff']);

}

})();
10 changes: 10 additions & 0 deletions slate/source/javascripts/lib/_datepicker.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions slate/source/layouts/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,17 @@ under the License.
<div class="lang-selector">
<% language_tabs.each do |lang| %>
<% if lang.is_a? Hash %>
<a href="#" data-language-name="<%= lang.keys.first %>"><%= lang.values.first %></a>
<a href="#" class="tab-selector" data-language-name="<%= lang.keys.first %>"><%= lang.values.first %></a>
<% else %>
<a href="#" data-language-name="<%= lang %>"><%= lang %></a>
<a href="#" class="tab-selector" data-language-name="<%= lang %>"><%= lang %></a>
<% end %>
<% end %>
</div>
<% end %>
<div id="diff-scroll-buttons" class="scroll-buttons">
<a href="#" id="scroll-prev" title="Previous" class="scroll-button previous round">&#8249;</a>
<a href="#" id="scroll-next" title="Next" class="scroll-button next round">&#8250;</a>
</div>
</div>
</div>
</body>
Expand Down
Loading

0 comments on commit 3be8470

Please sign in to comment.