Skip to content

Add 'Expires' to security.txt genform - #51

Merged
EdOverflow merged 8 commits into
securitytxt:masterfrom
joker314:feat/add-expires
Mar 5, 2021
Merged

EdOverflow merged 8 commits into
securitytxt:masterfrom
joker314:feat/add-expires

Conversation

@joker314

@joker314 joker314 commented Sep 19, 2020

Copy link
Copy Markdown
Contributor

Resolves #41

Here is what it would look like if you're using a browser which doesn't support date or time inputs. An example of such a browser is Safari for time, or Internet Explorer for both (although in this PR I've decided to write JS which does not support IE):

Two text inputs next to each other, with the greyed out placeholder stating the format for the first is YYYY-MM-DD and the format for the second is HH:MM

This is what it looks like for most modern browsers (the date format will be locale-sensitive):

A date input in the form dd/mm/yyyy and the time input in the form --:--

Where clicking on the appropriate icons will bring up the browser's calendar or time UI.

The two inputs are set to 'required' but there's currently no validation otherwise. If you're using a modern browser, there's not really a way of inputting an invalid date; but if you're using the text versions then you could mess it up completely. We'll add validation for all the fields in another PR soon.

This PR should be good to merge 👍

@joker314

Copy link
Copy Markdown
Contributor Author

I've merged in the changes from #68. Then, I added some page variables in the YAML:

  • latest_draft_version holds the version suffix (dash + version number) of the latest Internet draft.
  • genform_version gives the last version of the Internet draft for which the https://securitytxt.org is up-to-date
  • draft_genform_delta holds an HTML string describing the differences between the two versions

I then used Liquid to automatically choose between the currently displayed message (if the two version numbers don't match), or this new green message if they do match

Green form is up-to-date message

The image reads

Form is up-to-date

This form is up-to-date with the latest Internet draft at the time of writing. The Internet draft is subject to change, so you may want to verify that version -10 is still the latest version — and if not, to check for any differences.

The hyperlink opens in a new tab.

The idea is that in the future, we will quickly be able to update the website to show the warning notice if there is a change to the Internet draft - this is just an update to the YAML so will not require too much thought. See commit d1dc488 for an example (lines 75-85) of how to fill in the draft_genform_delta field in a multi-line way.

@joker314

Copy link
Copy Markdown
Contributor Author

I've now fixed an issue where the outputted date format was not compliant with RFC 5322. I've also added the weekday. An example output now looks like this:

Expires: Tue, 11 Apr 2020 14:14 +0000

This omits seconds, but they are optional anyway. The time is just the value of the HTML time input. It's possible to get the HTML time input to include seconds, but this seems unnecessary and there seem to be some browser quirks with it.

I've also refactored to remove the hard coding of the month names.

This should now be ready to review 👍

@joker314

Copy link
Copy Markdown
Contributor Author

I've now rephrased the Canonical description, which might be out of scope for this PR (I can file separately if needed), because I think the old description was a bit inaccurate
It now says "The URLs for accessing your security.txt file. It is important to include this if you are digitally signing the security.txt file, so that the location of the security.txt file can be digitally signed too."

@EdOverflow
EdOverflow merged commit eecdd19 into securitytxt:master Mar 5, 2021
@EdOverflow

Copy link
Copy Markdown
Member

Thank you, @joker314!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New field: Expires

2 participants