Skip to content

Register a new secret agent #73

Answered by igo95862
benjamin-grzimek asked this question in Q&A
Discussion options

You must be logged in to vote

After reading NetworkManager documentation I realized that the agent is not required to obtain any D-Bus names.

So I fixed your code and added example of overriding the agent methods:

from __future__ import annotations

from asyncio import new_event_loop
from typing import Any

import sdbus
from sdbus_async.networkmanager import (
    NetworkManagerSecretAgentInterfaceAsync,
    NetworkManagerAgentManager,
    NetworkManagerConnectionProperties,
)

sdbus.set_default_bus(sdbus.sd_bus_open_system())


class MySecretAgent(NetworkManagerSecretAgentInterfaceAsync):
    @sdbus.dbus_method_async_override()
    async def get_secrets(
        self,
        connection: NetworkManagerConnectionPrope…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@benjamin-grzimek
Comment options

@igo95862
Comment options

Answer selected by benjamin-grzimek
@igo95862
Comment options

@benjamin-grzimek
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants