creativecommons.org icon indicating copy to clipboard operation
creativecommons.org copied to clipboard

Use HTTPS links for the license chooser

Open kgodey opened this issue 6 years ago • 13 comments
trafficstars

Feedback through info@ In the license selection page [Choose a License] where it spits out html metadata, can you modify it so that it generates the links in https (it currently gives http, but changing that to https doesn't break anything)?

Screen Shot 2020-10-21 at 09 16 11

kgodey avatar Mar 26 '19 04:03 kgodey

No it shouldn't break anything.

We had a discussion a couple of years ago where changed the licenses to HTTPS by default and redirect all http traffic to https traffic. At the time it did break other functionality that we decided to remove (see #718 if you want to see what we were removing).

mzeinstra avatar Apr 03 '19 17:04 mzeinstra

I think I would like to work on this issue. I am having a bit of trouble finding the file(s) with the JS for the metadata generator, though. @kgodey

akmadian avatar Apr 14 '19 18:04 akmadian

@akmadian I'm not a cc developer, but I know where this is. It seems like part of the 'cc engine': https://github.com/creativecommons/cc.engine/tree/master/cc/engine

mzeinstra avatar Apr 14 '19 20:04 mzeinstra

that sounds right to me, @aldenstpage can you confirm?

kgodey avatar Apr 15 '19 17:04 kgodey

@mzeinstra is right, the current version of the chooser lives in cc.engine

aldenstpage avatar Apr 15 '19 18:04 aldenstpage

I scoured the code in de cc.engine for references to using http over https. But if I understand correctly that ancient system uses http://creativecommons.org/licenses/index.rdf to select and present available licenses.

If so than no external party can honestly provide you with any guidance other than scrapping the cc engine en rebuilding that >10 year old script with something more contemporary and with up-to-date documentation. :)

If so than this also relates to whole license link translation issue: https://github.com/creativecommons/creativecommons.org/issues?q=is%3Aissue+is%3Aopen+label%3A%22License+Link+Translation+or+URL+Problem%22

mzeinstra avatar Apr 17 '19 12:04 mzeinstra

creativecommons/cc.engine

  1. cc/engine/chooser/xmp_template.py
  2. cc/engine/chooser/views.py
    1. def choose_xmp_view(request): (see line 572)
      • license variable set by calling the _issue_license(request_form) function (see line 574)
    2. def _issue_license(request_form): (see line 159)
      • returns value set by cc.license.by_code function (ex. see line 178
      • OR returns value set by STANDARD_SELECTOR.by_answers(answers) function (see line 206)
    3. STANDARD_SELECTOR definition contains http url (see line 29):
      STANDARD_SELECTOR = cc.license.LicenseSelector(
      "http://creativecommons.org/license/")
      

creativecommons/cc.license

...ok, I ran out of steam, but there are multiple string occurrences:

cc/license/jurisdictions/__init__.py
80:                'http://creativecommons.org/license/')

cc/license/tests/test_questions.py
13:            'standard', 'http://creativecommons.org/license/')

cc/license/tests/test_lib.py
123:            'http://creativecommons.org/license/sampling/'),

cc/license/_lib/functions.py
289:            '{ ?license cc:licenseClass <http://creativecommons.org/license/> .'

cc/license/_lib/classes.py
337:          'http://creativecommons.org/license/'

TimidRobot avatar Apr 17 '19 18:04 TimidRobot

@mzeinstra the future of the chooser/license software is beyond the scope of this issue :)

Internally, we're still working on the preparing to have a discussion about their future. Please feel free to open a new issue if you have additional thoughts, opinions, etc.!

TimidRobot avatar Apr 17 '19 19:04 TimidRobot

Yep, I was wondering where this fit in with GSoC ;) @TimidRobot

akmadian avatar Apr 17 '19 20:04 akmadian

@TimidRobot Thanks for the steam :) and I take my comment back. It is indeed out of scope, but I was also wrong.

However, as far as I can tell none of the lines your refer to is the root of the issue here. http://creativecommons.org/license/ is a redirect to the chooser itself. All licenses have the root http://creativecommons.org/licenses/ (not the plural of license.

But your steam did help me probably pinpoint the actual point at which this is set: LICENSES_BASE = 'http://creativecommons.org/licenses/'

at https://github.com/creativecommons/cc.license/blob/a134299fdb0e882b84a2c181afc5588e13ae32df/cc/license/_lib/functions.py#L13

mzeinstra avatar Apr 18 '19 11:04 mzeinstra

@kgodey I would like to work on this issue. Do I just need to change HTTP to https? license

SaravgiYash avatar Oct 12 '20 09:10 SaravgiYash

tagging @TimidRobot to answer the question.

kgodey avatar Oct 16 '20 16:10 kgodey

The root of this issue is that the legacy ccEngine uses the RDF data as the source of its truth. The RDF data uses http:// and that is unlikely to be change (License URIs use http uri scheme, not https · Issue #7 · creativecommons/cc.licenserdf).

Changing LICENSES_BASE won't work because it will no longer match the RDF (ex. cc/license/_lib/functions.py Line 84). The code needs to be refactored to accept/work with both HTTP and HTTPS while preferring HTTPS.

It may be better to focus on releasing the replacement creativecommons/chooser instead.

TimidRobot avatar Oct 22 '20 14:10 TimidRobot