Skip to content

Commit

Permalink
feat: next api auth
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsdaniels committed Aug 29, 2024
1 parent e30a2cd commit ddef1e0
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 112 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-days-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codedazur/cdk-site-distribution": minor
---

Additional behaviors are now supported.
5 changes: 5 additions & 0 deletions .changeset/thick-lamps-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codedazur/cdk-next-app": minor
---

Authentication is now disabled by default for the API route, even if authentication is prvided for the default behavior.
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/cdk-docker-cluster/src/constructs/DockerCluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ interface SourceProps {
/**
* An Docker cluster on a load balanced Fargate service on EC2, using an image
* built from a Dockerfile in a directory and pushed to ECR.
* @todo Make the distribution and laod balancer optional, to reduce cost and
* increase deployment speed for development environments.
*/
export class DockerCluster extends Construct {
public readonly domain?: string;
Expand Down
10 changes: 10 additions & 0 deletions packages/cdk-next-app/src/constructs/NextApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ export class NextApp extends DockerCluster {
port,
...service,
},
distribution: {
...props.distribution,
behaviors: {
...props.distribution?.behaviors,
"/api/*": {
authentication: false,
...props.distribution?.behaviors?.["/api/*"],
},
},
},
...props,
});
}
Expand Down
3 changes: 2 additions & 1 deletion packages/cdk-site-distribution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"constructs": ">=10"
},
"dependencies": {
"@codedazur/cdk-cache-invalidator": "^1.2.1"
"@codedazur/cdk-cache-invalidator": "^1.2.1",
"@codedazur/essentials": "^1.10.1"
},
"devDependencies": {
"@types/node": "^20.14.10",
Expand Down
Loading

0 comments on commit ddef1e0

Please sign in to comment.