security
The security module reports the security identity of the active VFS target.
Platform-specific types are exposed by security.unix and
security.windows.
Functions
user_name uid?
Returns a user name from the active VFS target. With no argument, resolves the real user ID on Unix or the access token's user SID on Windows. With a user ID, resolves that ID on Unix.
Parameters:
| Name | Type | Description |
|---|---|---|
uid |
Int? |
Unix user ID; defaults to UID |
Returns: Str
Errors:
- Raises
sys.NotFoundErrorwhen the ID is unknown. - Raises
UnsupportedErrorwhen an ID is supplied for a Windows target.
user_id name
Resolves a Unix user name in the active VFS target.
Returns: Int
Errors:
- Raises
sys.NotFoundErrorwhen the name is unknown. - Raises
UnsupportedErrorfor Windows targets.
group_name gid
Resolves a Unix group ID in the active VFS target.
Returns: Str
Errors:
- Raises
sys.NotFoundErrorwhen the ID is unknown. - Raises
UnsupportedErrorfor Windows targets.
group_id name
Resolves a Unix group name in the active VFS target.
Returns: Int
Errors:
- Raises
sys.NotFoundErrorwhen the name is unknown. - Raises
UnsupportedErrorfor Windows targets.
unix_info()
Returns Unix security information captured for the active VFS context.
Returns: security.unix.Identity
Errors:
- Raises
UnsupportedErrorwhen the active VFS target is Windows.
token_info()
Returns Windows token information captured for the active VFS context.
Returns: security.windows.TokenInfo
Errors:
- Raises
UnsupportedErrorwhen the active VFS target is Unix.