Skip to content

Commit c5c4541

Browse files
app-rails: Update template-application-rails to version 1.0.0.post8.dev0+7fd27de
1 parent 98e8620 commit c5c4541

16 files changed

Lines changed: 172 additions & 125 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v1.0.0-3-gc7f7e95
2+
_commit: v1.0.0-8-g7fd27de
33
_src_path: https://github.com/navapbc/template-application-rails
44
app_local_port: 3100
55
app_name: app-rails

app-rails/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This is a [Ruby on Rails](https://rubyonrails.org/) application. It includes:
99
- Active Storage configuration with AWS S3
1010
- Action Mailer configuration with AWS SES
1111
- Authentication with [devise](https://github.com/heartcombo/devise) and AWS Cognito
12+
- Integration with Azure services, including
13+
- Database integration with Azure PostgreSQL using Entra ID
1214
- Internationalization (i18n)
1315
- Authorization using [pundit](https://github.com/varvet/pundit)
1416
- Linting and code formatting using [rubocop](https://rubocop.org/)
@@ -52,6 +54,7 @@ Below are the primary directories to be aware of when working on the app:
5254
- By default, `docker` is used. To change this, set the `CONTAINER_CMD` variable to `finch` (or whatever your container runtime is) in the shell.
5355
- An AWS account with a Cognito User Pool and App Client configured
5456
- By default, the application configures authentication using AWS Cognito
57+
- Or an Azure subscription
5558

5659
### 💾 Setup
5760

@@ -105,6 +108,31 @@ AUTH_ADAPTER=cognito
105108

106109
You will need to set the other cognito variables as well; setting `AUTH_ADAPTER` alone will merely set the auth flow to cognito, not enable cognito log in.
107110

111+
#### Database Authentication
112+
113+
The application supports three database authentication methods, controlled by the `DB_AUTH_METHOD` environment variable in your `.env` file:
114+
115+
| `DB_AUTH_METHOD` | Description | When to use |
116+
|---|---|---|
117+
| *(unset or blank)* | Use `DB_PASSWORD` as-is | Local development |
118+
| `aws_iam` | AWS RDS IAM auth token | Deployed on AWS |
119+
| `azure_entra` | Azure Managed Identity token via MS Entra ID | Deployed on Azure |
120+
121+
**Local development** (default): Leave `DB_AUTH_METHOD` unset in your `.env`. The app uses `DB_PASSWORD` directly — no further configuration needed.
122+
123+
**AWS (RDS IAM)**: Set the following in your `.env`:
124+
```
125+
DB_AUTH_METHOD=aws_iam
126+
```
127+
128+
**Azure (Entra ID)**: Set the following in your `.env`:
129+
```
130+
DB_AUTH_METHOD=azure_entra
131+
AZURE_DB_RESOURCE_URI=https://ossrdbms-aad.database.windows.net
132+
```
133+
134+
`AZURE_DB_RESOURCE_URI` is the audience URI used when requesting an access token from MS Entra ID. For Azure Database for PostgreSQL Flexible Server the value is `https://ossrdbms-aad.database.windows.net`. Consult the Azure documentation if using a different database service.
135+
108136
#### IDE tips
109137

110138
<details>

app-rails/app/assets/config/manifest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@
1616
// Compiled CSS and JS
1717
//= link_tree ../builds
1818
//= link application.css
19-
//= link custom.css

app-rails/app/assets/stylesheets/_overrides.scss

Lines changed: 0 additions & 6 deletions
This file was deleted.

app-rails/app/assets/stylesheets/_uswds-overrides.scss

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
11
@forward "uswds-theme";
22
@forward "uswds";
3-
@forward "uswds-overrides";
4-
@forward "overrides";
3+
4+
@use "uswds-core" as *;
5+
6+
// =========================================================
7+
// Base typography
8+
// =========================================================
9+
h1,
10+
h2,
11+
h3,
12+
h4,
13+
label,
14+
legend {
15+
text-wrap: balance;
16+
}
17+
18+
.usa-breadcrumb + h1 {
19+
margin-top: units(3);
20+
}
21+
22+
p,
23+
li,
24+
.usa-hint {
25+
text-wrap: pretty;
26+
}
27+
28+
// =========================================================
29+
// Custom utilities missing from USWDS (for now)
30+
// =========================================================
31+
32+
// Gap - USWDS has grid-gap but it doesn't work with flexbox
33+
@for $i from 0 through 10 {
34+
.gap-#{$i} {
35+
gap: units($i);
36+
}
37+
}
38+
39+
// =========================================================
40+
// Developer tooling
41+
// =========================================================
42+
// This shows when an i18n key is missing a value
43+
.translation_missing {
44+
color: red;
45+
font-weight: bold;
46+
border: 3px dashed red;
47+
}

app-rails/app/assets/stylesheets/custom.scss

Lines changed: 0 additions & 4 deletions
This file was deleted.

app-rails/app/controllers/application_controller.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ class ApplicationController < ActionController::Base
99
after_action :verify_authorized, except: :index
1010
after_action :verify_policy_scoped, only: :index
1111

12-
# Make sure templates in app/views/overrides are used if present
13-
prepend_view_path ActionView::FileSystemResolver.new(Rails.root.join("app/views/overrides"))
14-
1512
# Set the active locale based on the URL
1613
# For example, if the URL starts with /es-US, the locale will be set to :es-US
1714
def switch_locale(&action)
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# frozen_string_literal: true
22

33
class ApplicationMailer < ActionMailer::Base
4-
# Make sure templates in app/views/overrides are used if present
5-
prepend_view_path ActionView::FileSystemResolver.new(Rails.root.join("app/views/overrides"))
6-
74
default from: ENV["AWS_SES_FROM_EMAIL"] || ENV["SES_EMAIL"]
85
layout "mailer"
96
end

app-rails/app/views/overrides/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)