Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CREDENTIALS protocol to allow Erlang application to work as credentials provider #44

Open
hauleth opened this issue May 4, 2024 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@hauleth
Copy link
Owner

hauleth commented May 4, 2024

Quoting docs:

If referencing an AF_UNIX stream socket to connect to, the connection will originate from an abstract namespace socket, that includes information about the unit and the credential ID in its socket name. Use getpeername(2) to query this information. The returned socket name is formatted as NUL RANDOM "/unit/" UNIT "/" ID, i.e. a NUL byte (as required for abstract namespace socket names), followed by a random string (consisting of alphadecimal characters), followed by the literal string "/unit/", followed by the requesting unit name, followed by the literal character "/", followed by the textual credential ID requested. Example: "\0adf9d86b6eda275e/unit/foobar.service/credx" in case the credential "credx" is requested for a unit "foobar.service". This functionality is useful for using a single listening socket to serve credentials to multiple consumers.

I wonder how many users would be for such feature to add module that would support this protocol to generate credentials on the fly.

The API could be exposed as a wrapper on gen_server that would listen on given socket, parse peer name, and then call 2-ary function (first argument would contain unit name, second credential ID).

@hauleth hauleth added enhancement New feature or request question Further information is requested labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant