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

problem: User-Id field in zap response is not populated #1711

Merged
merged 3 commits into from
Jul 21, 2017

Conversation

JustinAzoff
Copy link
Contributor

problem: zauth tests do not check User-Id metadata

Solution: update the PLAIN and CURVE tests to fetch and verify the
User-Id metadata set by ZAP

problem: User-Id field in zap response is not populated.

According to ZAP spec:

user id: this MAY provide the user identity in case of a 200 status, for
use by applications. For other statuses, it SHALL be empty.

Solution: This adds a char pointer in the zap request struct that can
point to the the username, client_key, or principal fields.

With this change zframe_meta(frame, "User-Id") returns the public key
for a connection. This enables a use case where you have a long lived
connection authenticated by a key or password and want to verify that the
user/key still exists.

zframe_t *frame = zframe_recv(server);
const char *user_id = zframe_meta(frame, "User-Id");
if(user_id!=NULL) {
    zcert_t *c = zcertstore_lookup(store, user_id);
    if(!c)
        //Certificate no longer exists in store!
}

According to ZAP spec:

user id: this MAY provide the user identity in case of a 200 status, for
use by applications. For other statuses, it SHALL be empty.

Solution:  This adds a char pointer in the zap request struct that can
point to the the username, client_key, or principal fields.

With this change zframe_meta(frame, "User-Id") returns the public key
for a connection.  This enables a use case where you have a long lived
connection authenticated by a key or password and want to verify that the
user/key still exists.

    zframe_t *frame = zframe_recv(server);
    const char *user_id = zframe_meta(frame, "User-Id");
    if(user_id!=NULL) {
        zcert_t *c = zcertstore_lookup(store, user_id);
        if(!c)
            //Certificate no longer exists in store!
    }
Solution: update the PLAIN and CURVE tests to fetch and verify the
User-Id metadata set by ZAP
solution: Only run this test on newer versions of zmq
@bluca bluca merged commit 725d7e7 into zeromq:master Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants