Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre commit conf #882

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
exclude: 'docs|.git|.tox|.venv'
default_stages: [commit]
fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: |
(?x)^(
tests/extra_lines.crt
)$
- id: check-yaml
- id: check-toml
- id: check-case-conflict
- id: check-merge-conflict
- id: debug-statements
- id: detect-private-key
exclude: |
(?x)^(
tests/.+|
example/.+
)$

- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/PyCQA/autoflake
rev: 'v1.7.7'
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--ignore-init-module-imports']

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
args: ['--settings-path=pyproject.toml']

- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject, flake8-bugbear, flake8-logging-format]
verbose: true
1 change: 0 additions & 1 deletion example/README
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ To generate new keys, run create_key.sh and follow its instructions.

There are alternate IdP and SP configs in idp2_repoze/ and sp-repoze/ that
are still in flux; do not use them unless you know what you are doing.

1 change: 0 additions & 1 deletion example/idp2/static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/* Sample css file */

4 changes: 3 additions & 1 deletion example/idp2_repoze/modules/login.mako.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from mako import cache, runtime
from mako import cache
from mako import runtime


UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
Expand Down
5 changes: 4 additions & 1 deletion example/idp2_repoze/modules/root.mako.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from mako import runtime, filters, cache
from mako import cache
from mako import filters
from mako import runtime


UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
Expand Down
1 change: 0 additions & 1 deletion example/idp2_repoze/static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/* Sample css file */

2 changes: 1 addition & 1 deletion example/sp-repoze/sp_conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ CONFIG = {
},
"loglevel": "debug",
}
}
}
2 changes: 1 addition & 1 deletion example/sp-repoze/sp_conf.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ CONFIG = {
},
"loglevel": "debug",
}
}
}
2 changes: 1 addition & 1 deletion example/sp-repoze/who.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ remote_user_key = REMOTE_USER
plugins =
saml2auth
auth_tkt

[authenticators]
# plugin_name;classifier_name.. or just plugin_name (good for any)
plugins = saml2auth
Expand Down
34 changes: 14 additions & 20 deletions src/saml2/data/schemas/envelope.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

<!-- Schema for the SOAP/1.1 envelope

Portions © 2001 DevelopMentor.
© 2001 W3C (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
Portions © 2001 DevelopMentor.
© 2001 W3C (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.

This document is governed by the W3C Software License [1] as described in the FAQ [2].
[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:

Permission to use, copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make:

1. The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
1. The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.

2. Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright © 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"
2. Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright © 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"

3. Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
3. Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)

Original W3C files; http://www.w3.org/2001/06/soap-envelope
Changes made:
Changes made:
- reverted namespace to http://schemas.xmlsoap.org/soap/envelope/
- reverted mustUnderstand to only allow 0 and 1 as lexical values
- made encodingStyle a global attribute 20020825
Expand All @@ -36,7 +36,7 @@ The name and trademarks of copyright holders may NOT be used in advertising or p
xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/"
targetNamespace="http://schemas.xmlsoap.org/soap/envelope/" >


<!-- Envelope, header and body -->
<xs:element name="Envelope" type="tns:Envelope" />
<xs:complexType name="Envelope" >
Expand All @@ -55,7 +55,7 @@ The name and trademarks of copyright holders may NOT be used in advertising or p
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax" />
</xs:complexType>

<xs:element name="Body" type="tns:Body" />
<xs:complexType name="Body" >
<xs:sequence>
Expand All @@ -70,9 +70,9 @@ The name and trademarks of copyright holders may NOT be used in advertising or p
</xs:anyAttribute>
</xs:complexType>


<!-- Global Attributes. The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. -->
<xs:attribute name="mustUnderstand" >
<xs:attribute name="mustUnderstand" >
<xs:simpleType>
<xs:restriction base='xs:boolean'>
<xs:pattern value='0|1' />
Expand Down Expand Up @@ -106,21 +106,15 @@ The name and trademarks of copyright holders may NOT be used in advertising or p
<xs:element name="faultcode" type="xs:QName" />
<xs:element name="faultstring" type="xs:string" />
<xs:element name="faultactor" type="xs:anyURI" minOccurs="0" />
<xs:element name="detail" type="tns:detail" minOccurs="0" />
<xs:element name="detail" type="tns:detail" minOccurs="0" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="detail">
<xs:sequence>
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
</xs:sequence>
<xs:anyAttribute namespace="##any" processContents="lax" />
<xs:anyAttribute namespace="##any" processContents="lax" />
</xs:complexType>

</xs:schema>






6 changes: 3 additions & 3 deletions src/saml2/data/schemas/saml-schema-authn-context-2.0.xsd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
<xs:schema
targetNamespace="urn:oasis:names:tc:SAML:2.0:ac"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:tc:SAML:2.0:ac"
Expand All @@ -12,12 +12,12 @@
Location: http://docs.oasis-open.org/security/saml/v2.0/
Revision history:
V2.0 (March, 2005):
New core authentication context schema for SAML V2.0.
New core authentication context schema for SAML V2.0.
This is just an include of all types from the schema
referred to in the include statement below.
</xs:documentation>
</xs:annotation>

<xs:include schemaLocation="saml-schema-authn-context-types-2.0.xsd"/>

</xs:schema>
</xs:schema>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema targetNamespace="urn:oasis:names:tc:SAML:2.0:ac:classes:AuthenticatedTelephony"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:tc:SAML:2.0:ac:classes:AuthenticatedTelephony"
finalDefault="extension"
blockDefault="substitution"
Expand All @@ -10,13 +10,13 @@
<xs:redefine schemaLocation="saml-schema-authn-context-types-2.0.xsd">

<xs:annotation>
<xs:documentation>
<xs:documentation>
Class identifier: urn:oasis:names:tc:SAML:2.0:ac:classes:AuthenticatedTelephony
Document identifier: saml-schema-authn-context-auth-telephony-2.0
Location: http://docs.oasis-open.org/security/saml/v2.0/
Revision history:
V2.0 (March, 2005):
New authentication context class schema for SAML V2.0.
New authentication context class schema for SAML V2.0.
</xs:documentation>
</xs:annotation>

Expand Down Expand Up @@ -78,4 +78,4 @@

</xs:redefine>

</xs:schema>
</xs:schema>
8 changes: 4 additions & 4 deletions src/saml2/data/schemas/saml-schema-authn-context-ip-2.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<xs:schema
targetNamespace="urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocol"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocol"
finalDefault="extension"
blockDefault="substitution"
Expand All @@ -11,13 +11,13 @@
<xs:redefine schemaLocation="saml-schema-authn-context-types-2.0.xsd">

<xs:annotation>
<xs:documentation>
<xs:documentation>
Class identifier: urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocol
Document identifier: saml-schema-authn-context-ip-2.0
Location: http://docs.oasis-open.org/security/saml/v2.0/
Revision history:
V2.0 (March, 2005):
New authentication context class schema for SAML V2.0.
New authentication context class schema for SAML V2.0.
</xs:documentation>
</xs:annotation>

Expand Down Expand Up @@ -62,4 +62,4 @@

</xs:redefine>

</xs:schema>
</xs:schema>
10 changes: 5 additions & 5 deletions src/saml2/data/schemas/saml-schema-authn-context-ippword-2.0.xsd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema targetNamespace="urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword"
xmlns:ac="urn:oasis:names:tc:SAML:2.0:ac"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ac="urn:oasis:names:tc:SAML:2.0:ac"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword"
finalDefault="extension"
blockDefault="substitution"
Expand All @@ -11,13 +11,13 @@
<xs:redefine schemaLocation="saml-schema-authn-context-types-2.0.xsd">

<xs:annotation>
<xs:documentation>
<xs:documentation>
Class identifier: urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword
Document identifier: saml-schema-authn-context-ippword-2.0
Location: http://docs.oasis-open.org/security/saml/v2.0/
Revision history:
V2.0 (March, 2005):
New authentication context class schema for SAML V2.0.
New authentication context class schema for SAML V2.0.
</xs:documentation>
</xs:annotation>

Expand Down Expand Up @@ -61,7 +61,7 @@
</xs:restriction>
</xs:complexContent>
</xs:complexType>

</xs:redefine>

</xs:schema>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema targetNamespace="urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos"
finalDefault="extension"
blockDefault="substitution"
Expand All @@ -10,13 +10,13 @@
<xs:redefine schemaLocation="saml-schema-authn-context-types-2.0.xsd">

<xs:annotation>
<xs:documentation>
<xs:documentation>
Class identifier: urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos
Document identifier: saml-schema-authn-context-kerberos-2.0
Location: http://docs.oasis-open.org/security/saml/v2.0/
Revision history:
V2.0 (March, 2005):
New authentication context class schema for SAML V2.0.
New authentication context class schema for SAML V2.0.
</xs:documentation>
</xs:annotation>

Expand Down Expand Up @@ -47,8 +47,8 @@
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:complexType>

<xs:complexType name="PrincipalAuthenticationMechanismType">
<xs:complexContent>
<xs:restriction base="PrincipalAuthenticationMechanismType">
Expand All @@ -59,7 +59,7 @@
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="AuthenticatorBaseType">
<xs:complexContent>
<xs:restriction base="AuthenticatorBaseType">
Expand All @@ -80,4 +80,4 @@

</xs:redefine>

</xs:schema>
</xs:schema>
Loading