Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Scripts outdated / _parse_credentials doesn't support callbacks any more #16

@chrysn

Description

@chrysn

During 2625755, the scripts were not updated, making them unrunnable (they import OKP and that sort).

I only noticed because I was looking into _parse_credentials which now is a lot type stricter (appreciated), but in that course lost the ability to implicitly process callables. (That functionality was broken beforehand too, which didn't matter for the examples as they only ran in SIGN_SIGN without verification so the cred was never used).

Sure this could be fixed easily, but making _peer_cred work with callbacks required some ugly tricks anyway, so my suggestion is to rather not fix it that way but make EdhocRole's parse_cred be unconditionally callable in the first place (fewer distinct code paths, and for the rare cases where the peer is known in a hardcoded fashion a lambda id: foo will do).

Then the peer_cred passed in would be stored once, _peer_cred and _remote_authkey remain unavailable until a peer cred ID came in, and when that comes in the peer_cred function is once called, its output fed through _parse_credentials and it's all good again.

Can provide a PR if you agree with the roadmap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions