Skip to content

AuthorizedSession is being constructed with incorrect values #91

@kronosapiens

Description

@kronosapiens

In account-wasm/src/types/session.rs we have the following:

impl From<account_sdk::storage::SessionMetadata> for AuthorizedSession {
    fn from(value: account_sdk::storage::SessionMetadata) -> Self {
        AuthorizedSession {
            session: value.session.clone().into(),
            authorization: value
                .credentials
                .map(|c| c.authorization.into_iter().map(Into::into).collect()),
            is_registered: value.is_registered,
            expires_at: value.session.inner.expires_at,
            allowed_policies_root: value.session.inner.allowed_policies_root.into(),
            metadata_hash: value.session.inner.allowed_policies_root.into(), // why allowed_policies_root?
            session_key_guid: value.session.inner.session_key_guid.into(),
            guardian_key_guid: value.session.inner.allowed_policies_root.into(), // why allowed_policies_root?
        }
    }
}

Specifically, metadata_hash and guardian_key_guid are being set to allowed_policies_root. Is this a bug? If sessions are being hashed inconsistently, it might explain why users are seeing session/not-registered errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions