-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from digitaldesigndj/main
update and upgrade with some tests added and an action for the tests, also I did a `deno fmt` @digitaldesigndj san Thank you.
- Loading branch information
Showing
37 changed files
with
393 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This workflow will install Deno then run Deno fmt and test. | ||
# For more information see: https://github.com/denoland/setup-deno | ||
|
||
name: Deno Deploy & Test | ||
|
||
on: | ||
push: | ||
branches: ["main","test"] | ||
pull_request: | ||
branches: ["main","test"] | ||
|
||
permissions: | ||
id-token: write # This is required to allow the GitHub Action to authenticate with Deno Deploy. | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
DENO_ENV: testing | ||
BASE_URL: http://localhost:8000 | ||
DENO_DIR: deno_dir | ||
APP_KEY: not-secret-at-all | ||
steps: | ||
- name: Setup repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.35.2 | ||
|
||
- name: Verify formatting | ||
run: deno fmt --check | ||
|
||
- name: Cache Deno dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
key: denoDeps-${{ hashFiles('deno.lock') }} | ||
path: ${{ env.DENO_DIR }} | ||
|
||
- name: Run tests | ||
run: deno test -A --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,8 @@ import { | |
Fresh Session currently uses [JSON Web Token](https://jwt.io/) under the hood to | ||
create and manage session in the cookies. | ||
|
||
JWT requires a secret key to sign new tokens. Fresh Session uses the | ||
secret key from your [environment variable](https://deno.land/std/dotenv/load.ts) | ||
JWT requires a secret key to sign new tokens. Fresh Session uses the secret key | ||
from your [environment variable](https://deno.land/std/dotenv/load.ts) | ||
`APP_KEY`. | ||
|
||
If you don't know how to setup environment variable locally, I wrote | ||
|
@@ -60,8 +60,6 @@ interacting with your session. | |
|
||
```tsx | ||
// ./routes/dashboard.tsx | ||
/** @jsx h */ | ||
import { h } from "preact"; | ||
import { Handlers, PageProps } from "$fresh/server.ts"; | ||
import { WithSession } from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
|
@@ -91,7 +89,7 @@ export const handler: Handlers< | |
// /!\ This flashed data will disappear after accessing it one time. | ||
session.flash("success"); | ||
// Session Key Rotation only kv store and redis store. | ||
// Is not work in cookie store. | ||
// Is not work in cookie store. | ||
|
||
// Rotate the session key. Only supported by the kv store and redis store, not the cookie store. | ||
// If using the session for authentication, with a kv or redis store, it is recommended to rotate the key at login to prevent session fixation attack. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
{ | ||
"tasks": { | ||
"fixture": "deno run -A --watch=static/,routes/ tests/fixture/dev.ts" | ||
"fixture": "deno run -A --watch=tests/fixture/static/,tests/fixture/routes/ tests/fixture/dev.ts", | ||
"kv": "deno run -A --unstable --watch=example/use_kv_store/static/,example/use_kv_store/routes/ example/use_kv_store/dev.ts" | ||
}, | ||
"importMap": "./tests/fixture/import_map.json" | ||
"imports": { | ||
"$fresh/": "https://deno.land/x/[email protected]/", | ||
"$std/": "https://deno.land/[email protected]/", | ||
"cookiejar": "https://deno.land/x/[email protected]/mod.ts" | ||
}, | ||
"lock": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM denoland/deno:1.33.1 | ||
FROM denoland/deno:1.35.1 | ||
|
||
RUN apt-get update | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,20 @@ | |
"tasks": { | ||
"start": "deno run -A --unstable --watch=static/,routes/ dev.ts" | ||
}, | ||
"importMap": "./import_map.json", | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "preact" | ||
} | ||
}, | ||
"imports": { | ||
"$fresh/": "https://deno.land/x/[email protected]/", | ||
"preact": "https://esm.sh/[email protected]", | ||
"preact/": "https://esm.sh/[email protected]/", | ||
"preact-render-to-string": "https://esm.sh/*[email protected]", | ||
"@preact/signals": "https://esm.sh/*@preact/[email protected]", | ||
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]", | ||
"twind": "https://esm.sh/[email protected]", | ||
"twind/": "https://esm.sh/[email protected]/", | ||
"fresh-session/": "https://raw.githubusercontent.com/Octo8080X/fresh-session/main/" | ||
}, | ||
"lock": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM denoland/deno:1.25.1 | ||
FROM denoland/deno:1.35.2 | ||
|
||
RUN apt-get update | ||
RUN mkdir /usr/src/app | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,19 @@ | |
"tasks": { | ||
"start": "deno run -A --watch=static/,routes/ dev.ts" | ||
}, | ||
"importMap": "./import_map.json", | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "preact" | ||
} | ||
}, | ||
"imports": { | ||
"$fresh/": "https://deno.land/x/[email protected]/", | ||
"preact": "https://esm.sh/[email protected]", | ||
"preact/": "https://esm.sh/[email protected]/", | ||
"preact-render-to-string": "https://esm.sh/*[email protected]", | ||
"@preact/signals": "https://esm.sh/*@preact/[email protected]", | ||
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]", | ||
"redis/": "https://deno.land/x/[email protected]/", | ||
"fresh-session/": "https://deno.land/x/[email protected]/" | ||
}, | ||
"lock": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.