Skip to content

Commit

Permalink
Explicitly make allow_credentials required in CORS policy.
Browse files Browse the repository at this point in the history
This was the default for Bool fields until and including zope.schema 6.0.1.
In 6.1.0 this changed.
Since we have a default in the field definition, it does not look like any changes are needed for people using `plone.rest`.

Without this, we get errors like this on Jenkins with Plone coredev 6:

```
$ bin/test -s plone.rest
...
  File "/Users/maurits/shared-eggs/cp38/zope.configuration-4.4.0-py3.8.egg
/zope/configuration/config.py", line 869, in finish
    actions = self.handler(context, **args)
zope.configuration.xmlconfig.ZopeXMLConfigurationError:
File "/Users/maurits/community/plone-coredev/6.0/src/plone.rest/src/plone/rest/testing.zcml", line 163.2-167.6
    TypeError: cors_policy_directive() missing 1 required positional argument: 'allow_credentials'
```

See zopefoundation/zope.schema#104 (comment)
  • Loading branch information
mauritsvanrees committed Feb 10, 2021
1 parent ca24e17 commit 8d1ed68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions news/104.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Explicitly make ``allow_credentials`` required in CORS policy.
This was the default for Bool fields until and including zope.schema 6.0.1, but in 6.1.0 this changed.
[maurits]
1 change: 1 addition & 0 deletions src/plone/rest/zcml.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class ICORSPolicyDirective(Interface):
title=u"Support Credentials",
description=u"""Indicates whether the resource supports user
credentials in the request.""",
required=True,
default=False,
)

Expand Down

0 comments on commit 8d1ed68

Please sign in to comment.