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.
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:
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 useSecret.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 beorg.freedesktop.Secret.Generic
schema, which means no schema at all, so any attributes can be used. So thepassword_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.We can see that
gnome-keyring
add attributeattribute.gkr:compat:hashed:xdg:schema
and there are two original attributesaccount
andservice
. When the secret is locked. The attributes becomeattribute.gkr:compat:hashed:account
andattribute.gkr:compat:hashed:service
. And when executing the commandsecret-tool search --all xdg:schema com.github.pulb.mailnag
, the result is:There would be no actions.
The reason can be found in https://gitlab.gnome.org/GNOME/libsecret/-/issues/7.