Skip to content

pysaml2: 7.5.0 -> 7.5.2 #381222

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

Merged
merged 1 commit into from
Apr 5, 2025
Merged

pysaml2: 7.5.0 -> 7.5.2 #381222

merged 1 commit into from
Apr 5, 2025

Conversation

melvyn2
Copy link
Contributor

@melvyn2 melvyn2 commented Feb 11, 2025

This update adds a limit on the allowed version of pyopenssl, so an override for the correct version of the package was added (pyopenssl_24_2_1).

There is one new failing test:

FAILED tests/test_schema_validator.py::test_namespace_processing - saml2.xml.schema.XMLSchemaError: {'doc': '<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n            <saml2:Attribute Name="urn:mace:dir:attribute-def:uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">\n                <saml2:AttributeValue xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">alum11</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="urn:mace:terena.org:attribute-def:schacHomeOrganization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">\n                <saml2:AttributeValue xsi:nil="true" xsi:type="xs:string" /></saml2:Attribute></saml2:AttributeStatement>', 'error': '"global xs:simpleType/xs:complexType \'xs:string\' not found"'}

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@melvyn2
Copy link
Contributor Author

melvyn2 commented Feb 11, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 381222


aarch64-linux

❌ 1 package failed to build:
  • seahub
✅ 27 packages built:
  • matrix-synapse
  • matrix-synapse-plugins.matrix-synapse-ldap3
  • matrix-synapse-plugins.matrix-synapse-ldap3.dist
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam.dist
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider.dist
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth.dist
  • matrix-synapse-unwrapped
  • matrix-synapse-unwrapped.dist
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pyopenssl_24_2_1
  • python312Packages.pyopenssl_24_2_1.dev
  • python312Packages.pyopenssl_24_2_1.dist
  • python312Packages.pyopenssl_24_2_1.doc
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pyopenssl_24_2_1
  • python313Packages.pyopenssl_24_2_1.dev
  • python313Packages.pyopenssl_24_2_1.dist
  • python313Packages.pyopenssl_24_2_1.doc
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist

@melvyn2
Copy link
Contributor Author

melvyn2 commented Feb 11, 2025

Seahub will be fixed in #369550, just needs its pyopenssl version to be downgraded to match. It was already broken anyways so it shouldn't be an issue.

Comment on lines 12422 to 12431
pyopenssl_24_2_1 = pyopenssl.overridePythonAttrs (old: rec {
version = "24.2.1";
src = pkgs.fetchFromGitHub {
owner = "pyca";
repo = "pyopenssl";
tag = version;
hash = "sha256-/TQnDWdycN4hQ7ZGvBhMJEZVafmL+0wy9eJ8hC6rfio=";
};
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that in this case, the override should be declared in the pysaml2 derivation, not as a new package.

Any thoughts @mweinelt ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some dependents of pysaml2 (i.e. seahub) also depend directly on pyopenssl, and so they have to also somehow use the same version. pysaml2 could maybe expose it but that seems more complicated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they are downstream dependencies, don't they get pyopenssl as a transitive dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in that case they would have to remove pyopenssl from their list of direct dependencies. It's only a stylistic choice at this point, but IMO it would be better for the derivations to keep their direct dependencies explicit if possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fond of this duplication.
There is an initiative to switch to cryptography upstream: IdentityPython/pysaml2#977

Maybe, we could wait a bit to see how this turns out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that a solution is actually in sight, it does seem much better to wait.

@melvyn2 melvyn2 marked this pull request as draft February 13, 2025 15:56
@melvyn2
Copy link
Contributor Author

melvyn2 commented Mar 17, 2025

Seeing that the upstream PR has been stalled, maybe a temporary fix is still worth it?

@GaetanLepage
Copy link
Contributor

Seeing that the upstream PR has been stalled, maybe a temporary fix is still worth it?

Ok why not, but I would move the override in the pysaml2 derivation.

@melvyn2
Copy link
Contributor Author

melvyn2 commented Apr 3, 2025

Very late but I did get around to fixing this.

@melvyn2 melvyn2 marked this pull request as ready for review April 3, 2025 20:58
@melvyn2
Copy link
Contributor Author

melvyn2 commented Apr 3, 2025

Oops hadn't tested on master, something's still broken

@melvyn2
Copy link
Contributor Author

melvyn2 commented Apr 4, 2025

The only clean solution with recent openssl/pycryptography versions seems to be to patch in the PR, but I'm not sure how acceptable this is.

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 381222


x86_64-linux

✅ 20 packages built:
  • matrix-synapse
  • matrix-synapse-plugins.matrix-synapse-ldap3
  • matrix-synapse-plugins.matrix-synapse-ldap3.dist
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam.dist
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider.dist
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth.dist
  • matrix-synapse-unwrapped
  • matrix-synapse-unwrapped.dist
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist
  • seahub

aarch64-linux

✅ 20 packages built:
  • matrix-synapse
  • matrix-synapse-plugins.matrix-synapse-ldap3
  • matrix-synapse-plugins.matrix-synapse-ldap3.dist
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam.dist
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider.dist
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth.dist
  • matrix-synapse-unwrapped
  • matrix-synapse-unwrapped.dist
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist
  • seahub

x86_64-darwin

✅ 8 packages built:
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist

aarch64-darwin

✅ 8 packages built:
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist

Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like everything is building now!
A little bit cleaning and it should be ready.

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 381222


x86_64-linux

✅ 20 packages built:
  • matrix-synapse
  • matrix-synapse-plugins.matrix-synapse-ldap3
  • matrix-synapse-plugins.matrix-synapse-ldap3.dist
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam.dist
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider.dist
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth.dist
  • matrix-synapse-unwrapped
  • matrix-synapse-unwrapped.dist
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist
  • seahub

aarch64-linux

✅ 20 packages built:
  • matrix-synapse
  • matrix-synapse-plugins.matrix-synapse-ldap3
  • matrix-synapse-plugins.matrix-synapse-ldap3.dist
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam
  • matrix-synapse-plugins.matrix-synapse-mjolnir-antispam.dist
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider
  • matrix-synapse-plugins.matrix-synapse-s3-storage-provider.dist
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth
  • matrix-synapse-plugins.matrix-synapse-shared-secret-auth.dist
  • matrix-synapse-unwrapped
  • matrix-synapse-unwrapped.dist
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist
  • seahub

x86_64-darwin

✅ 8 packages built:
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist

aarch64-darwin

✅ 8 packages built:
  • python312Packages.djangosaml2
  • python312Packages.djangosaml2.dist
  • python312Packages.pysaml2
  • python312Packages.pysaml2.dist
  • python313Packages.djangosaml2
  • python313Packages.djangosaml2.dist
  • python313Packages.pysaml2
  • python313Packages.pysaml2.dist

Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GaetanLepage GaetanLepage merged commit fd60f37 into NixOS:master Apr 5, 2025
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants