Skip to content

Allow creating property file auth providers from a Buffer - #758

Open
jnbdz wants to merge 1 commit into
eclipse-vertx:masterfrom
SiteNetSoft:issue-728-properties-buffer
Open

Allow creating property file auth providers from a Buffer#758
jnbdz wants to merge 1 commit into
eclipse-vertx:masterfrom
SiteNetSoft:issue-728-properties-buffer

Conversation

@jnbdz

@jnbdz jnbdz commented Aug 11, 2026

Copy link
Copy Markdown

The property file authentication/authorization providers can only be created from a file system path, and the provider reads that path itself. As described in #728, this prevents loading the content from anywhere else — the classpath inside a fat jar, a remote location — or preprocessing it before parsing (Apache Camel wants to resolve environment variable references in the file, e.g. user.admin=${ADMIN_PASSWORD}).

This adds create(Vertx, Buffer) overloads to both PropertyFileAuthentication and PropertyFileAuthorization, taking the property file content directly:

vertx.fileSystem().readFile("auth.properties")
  .map(buffer -> PropertyFileAuthentication.create(vertx, buffer))

The issue suggested InputStream, but a Buffer felt more idiomatic for Vert.x (@VertxGen-friendly, non-blocking, and it is what FileSystem.readFile returns) while solving the same problem: the caller stays in control of how the content is loaded. The existing path-based overloads are unchanged; parsing is shared between both paths. For the buffer variant, the authorization provider id (previously the path) is the constant properties.

Includes tests and documentation.

Fixes #728

The property file authentication and authorization providers could only
be created from a file system path, read by the provider itself. This
prevents loading the content from the classpath, a remote location or
preprocessing it, e.g. to resolve environment variable references.

Add create overloads taking the property file content as a Buffer, so
callers stay in control of how the content is loaded.

Fixes eclipse-vertx#728
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.

AuthProperties to load from input stream so the resource can be loaded more flexible

1 participant