Code:
def _check_can_manage_secret(
self,
secret: Secret,
):
if secret.owner is None:
raise SecretNotFoundError(
'this secret is not owned by this unit/app or granted to it. '
'Did you forget passing it to State.secrets?',
)
...
Docs:
owner: Literal['unit', 'app', None] = None
Indicates if the secret is owned by this unit, this application, or another application/unit.
If None, the implication is that read access to the secret has been granted to this unit.