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

Change secret schema type to avoid no password prompt #231

Closed
wants to merge 1 commit into from
Closed

Change secret schema type to avoid no password prompt #231

wants to merge 1 commit into from

Conversation

shejialuo
Copy link

As shown in #213, mailnag won't authenticate on first start. The reason
can be found in https://gitlab.gnome.org/GNOME/libsecret/-/issues/7. It
is because that when creating schema using Secret.SchemaFlags.NONE.
The schema name is sent as attribute to match (xdg:schema). However,
for gnome-keyring side, when the secret is locked. The secret will have
extra attributes which makes that the lookup fails. And use
Secret.Schema.Flags.DONT_MATCH_NAME flag creates the schema can avoid
this situation.

However, there is also another situation, just make the schema name to
be None, which would be org.freedesktop.Secret.Generic schema, which
means no schema at all, so any attributes can be used. So the
password_lookpup_sync can also success to allow the password prompt.

This PR adopts the first solution, simply change the FLAG.

Closes #213


When using secret-tool search --all xdg:schema org.freedesktop.Secret.Generic. The following picture illustrates partial result.

image

We can see that gnome-keyring add attribute attribute.gkr:compat:hashed:xdg:schema and there are two original attributes account and service. When the secret is locked. The attributes become attribute.gkr:compat:hashed:account and attribute.gkr:compat:hashed:service. And when executing the command secret-tool search --all xdg:schema com.github.pulb.mailnag, the result is:

image

There would be no actions.

The reason can be found in https://gitlab.gnome.org/GNOME/libsecret/-/issues/7.

As shown in #213, mailnag won't authenticate on first start. The reason
can be found in https://gitlab.gnome.org/GNOME/libsecret/-/issues/7. It
is because that when creating schema using `Secret.SchemaFlags.NONE`.
The schema name is sent as attribute to match (`xdg:schema`). However,
for gnome-keyring side, when the secret is locked. The secret will have
extra attributes which makes that the lookup fails. And use
`Secret.Schema.Flags.DONT_MATCH_NAME` flag creates the schema can avoid
this situation.

However, there is also another situation, just make the schema name to
be `None`, which would be `org.freedesktop.Secret.Generic` schema, which
means no schema at all, so any attributes can be used. So the
`password_lookpup_sync` can also success to allow the password prompt.

This PR adopts the first solution, simply change the FLAG.

Closes #213
This pull request was closed.
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.

Mailnag won't authenticate on first start
1 participant