Giter Site home page Giter Site logo

Comments (6)

tsallinen avatar tsallinen commented on July 30, 2024 1

Some enhancements should be made to Hakunapi in order to enable PAAS or containerized deployment:

  • Support configuring database connection settings as environment variables (as an alternative to db.properties)
  • Optionally support Azure managed identity for database authentication (instead of username/password). See https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/connect-java?tabs=passwordless
  • Support environment variables as an alternative to any system properties ({context_path}.hakuna.config.path)
  • Construct links dynamically from request headers (Host, X-Forwarded-*) instead of static configuration (servers.dev.url)

from hakunapi.

jampukka avatar jampukka commented on July 30, 2024

If I understand the passwordless example correctly users should now be able to create their own version of hakunapi-simple-webapp-javax and include the

<dependency>
  <groupId>com.azure</groupId>
  <artifactId>azure-identity-extensions</artifactId>
  <version>1.0.0</version>
</dependency>

in the war project and configure their database connections with jdbcUrl instead of dataSourceClassName causing HikariCP to call DriverManager.getConnection(jdbcUrl, props) just like the example code does

Current example configuration:

dataSourceClassName=org.postgresql.ds.PGSimpleDataSource
dataSource.user=address_reader
dataSource.password=test
dataSource.databaseName=address_fin
dataSource.portNumber=5432
dataSource.serverName=localhost

How it could work:

jdbcUrl=jdbc:postgresql://${AZ_DATABASE_SERVER_NAME}.postgres.database.azure.com:5432/${AZ_DATABASE_NAME}?sslmode=require&authenticationPluginClassName=com.azure.identity.extensions.jdbc.postgresql.AzurePostgresqlAuthenticationPlugin
dataSource.user=address_reader

from hakunapi.

jampukka avatar jampukka commented on July 30, 2024

Quick test, adding

<dependency>
  <groupId>com.azure</groupId>
  <artifactId>azure-identity-extensions</artifactId>
  <version>1.0.0</version>
</dependency>

to hakunapi-source-postgis causes features.war to grow from 33mb to 51mb. Might not be an issue, but not the tiniest dependency to add

from hakunapi.

jampukka avatar jampukka commented on July 30, 2024

@tsallinen, did this

also get completed?

from hakunapi.

tsallinen avatar tsallinen commented on July 30, 2024

I am unable to verify that for now, but I think we can close this issue and open a new one later if further changes are needed. Hakunapi is now ready for containers.

from hakunapi.

teezip avatar teezip commented on July 30, 2024

As commented above "we can close this issue and open a new one later if further changes are needed".

from hakunapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.