Skip to content

💥 zb: Improved Address API#556

Merged
zeenix merged 11 commits intoz-galaxy:mainfrom
zeenix:address-rework
Jan 28, 2024
Merged

💥 zb: Improved Address API#556
zeenix merged 11 commits intoz-galaxy:mainfrom
zeenix:address-rework

Conversation

@zeenix
Copy link
Copy Markdown
Contributor

@zeenix zeenix commented Jan 26, 2024

Main changes:

  • Split transport bits of Address into a separate type, Transport.
  • Address now support GUIDs, rather than ignoring them.
  • Improved Guid type.
  • connection::Builder ensure GUID is correct if the client connection is constructed through an address with GUID in it.
  • Proper support for abstract unix sockets.

Fixes #329, #476.

@zeenix zeenix mentioned this pull request Jan 26, 2024
@zeenix zeenix force-pushed the address-rework branch 4 times, most recently from 9341a0a to 7b00773 Compare January 27, 2024 14:33
More like a type hierarchy. `Address` is no longer an enum but a struct
with hidden fields. This will allow us to add GUID information to address
in a following commit withough duplicating it for each transport variant.

AutolaunchScope code from Marc-Andre Lureau <marcandre.lureau@redhat.com>.

Fixes z-galaxy#476.
We previously just ignored GUIDs in addresses. No more. We now parse it,
if present and provide API to set a GUID on an `Address` instance.
`Guid` now has a lifetime parameter, and `OwnedGuid` is a new type that's
a wrapper around `Guid<'static>`. Internally, `Guid` is now a wrapper
around `zvariant::Str` and is now a very similar type to other
`zvariant::Str` wrapper types.

This also turns `guid` argument of `connection::Builder::server` into a
generic type.
If the client connection is constructed through an address with GUID in
it, we should verify this GUID is the same as one received from the server
during the handshake.
Add a new address::UnixPath variant for abstract sockets and replace our
hack with the abstract unix socket support from std.

Fixes z-galaxy#329.
This satisfies a new clippy lint.
@zeenix zeenix merged commit 8fbbe0a into z-galaxy:main Jan 28, 2024
@zeenix zeenix deleted the address-rework branch January 28, 2024 14:54
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.

Use std's abstract unix socket API

1 participant