Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jwt integration #8

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
bf530aa
scalafmtAll
bblfish Dec 31, 2021
c307151
https://github.com/httpwg/http-extensions/issues/1876
bblfish Jan 1, 2022
168ec47
All tests pass
bblfish Jan 1, 2022
e544360
scalafmtAll
bblfish Jan 1, 2022
ed21321
fix test suite bugs.
bblfish Jan 2, 2022
07fc726
fix minor test annoyances
bblfish Jan 2, 2022
7ae7921
add more Signing Http Messages tests
bblfish Jan 2, 2022
1917054
give more precise names for Public and Private keys
bblfish Jan 2, 2022
68379e0
fixes to enable github compilation
bblfish Jan 2, 2022
9719263
refactor Signature.Sign to return a Kleisli arrow
bblfish Jan 2, 2022
d586f1d
refeactor Verifier to return a F[(a,b)=>F[Bool]]
bblfish Jan 3, 2022
88b6b7b
rename Test classes and attributes
bblfish Jan 3, 2022
8be05af
Signer.sign => Signer.build, same for Verifier
bblfish Jan 3, 2022
4d215d5
Attempted reworking to use signer and verifier 1c
bblfish Jan 3, 2022
891f033
scalafmt
bblfish Jan 3, 2022
2333fd5
fix for CI (is there a way to run that locally?)
bblfish Jan 3, 2022
4ffd678
add only Java Support for ed25519
bblfish Jan 11, 2022
0e14a8a
used by https://github.com/bblfish/httpSig/commit/e967f7ded1bfc6ea1da…
bblfish Jan 24, 2022
49002fc
move to sbt-typelevel
bblfish Feb 7, 2022
3793b1f
https://oss.sonatype.org/content/repositories/snapshots/net/bblfish/c…
bblfish Feb 7, 2022
7a862da
README
bblfish Feb 8, 2022
cdce66d
format build
bblfish Feb 8, 2022
e8876e2
scala3 warning on @nowarn -> "never used"
bblfish Feb 8, 2022
de0bb8d
don't test on jdk8, limit to jdk 17 and jdk 11
bblfish Feb 9, 2022
2d224ac
fix warnings for Continuous Integration
bblfish Feb 9, 2022
69106e6
bouncy_Castle inconsistency fix
bblfish Feb 9, 2022
a31ad4c
lib updates
Oct 6, 2022
5c9dff7
compiles
bblfish Oct 6, 2022
7fdaf1f
prePR passes now.
bblfish Oct 6, 2022
7a91946
downgrade munit so that tests pass
bblfish Oct 6, 2022
fc91ba0
adding tests from signing http v.13 (problem with PEM in JS)
bblfish Nov 4, 2022
443ed54
using old `test-key-rsa-pss` works in JS
bblfish Nov 4, 2022
26e191d
PrePR fixes.
bblfish Nov 4, 2022
5172ebb
update build file
bblfish Nov 4, 2022
12ca462
minor changes in sbt
bblfish Nov 4, 2022
f5c5ef3
minimal change to duplicate https://github.com/httpwg/http-extensions…
bblfish Nov 5, 2022
8f3e75f
??? use 07 draft test-key-rsa-pss entirely for JS?
bblfish Nov 5, 2022
cfaeb98
Add negative tests.
bblfish Nov 5, 2022
1701f5e
update README (to re-run tests)
bblfish Nov 5, 2022
a1e07ef
fix line that was breaking tests
bblfish Nov 5, 2022
196c5ee
added all other examples
bblfish Nov 6, 2022
61e28fc
declarative restriction on Ed25519 for WebCryptAPI
bblfish Nov 6, 2022
c2f73fe
add documentation on keys for v13
bblfish Nov 6, 2022
25ff444
update scala
bblfish Nov 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
281 changes: 242 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,84 @@ name: Continuous Integration

on:
pull_request:
branches: ['**']
branches: ['**', '!update/**', '!pr/**']
push:
branches: ['**']
branches: ['**', '!update/**', '!pr/**']
tags: [v*]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [3.1.0, 2.12.15, 2.13.7]
java: [temurin@11]
scala: [3.1.3, 2.12.17, 2.13.8]
java: [temurin@17, temurin@11]
project: [rootJS, rootJVM]
jsenv: [NodeJS, Chrome, Firefox]
exclude:
- scala: 3.1.3
java: temurin@11
- scala: 2.12.17
java: temurin@11
- project: rootJS
java: temurin@11
- scala: 3.1.3
jsenv: Chrome
- scala: 3.1.3
jsenv: Firefox
- scala: 2.12.17
jsenv: Chrome
- scala: 2.12.17
jsenv: Firefox
- project: rootJVM
jsenv: Chrome
- project: rootJVM
jsenv: Firefox
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java (temurin@11)
- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand All @@ -54,23 +97,47 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Setup NodeJS v14 LTS
uses: actions/[email protected]
- name: Setup NodeJS v16 LTS
if: matrix.project == 'rootJS' && matrix.jsenv == 'NodeJS'
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16

- name: Check that workflows are up to date
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
run: 'sbt ''project ${{ matrix.project }}'' ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' ''project /'' githubWorkflowCheck'

- run: sbt ++${{ matrix.scala }} ci
- name: Check headers and formatting
if: matrix.java == 'temurin@17'
run: 'sbt ''project ${{ matrix.project }}'' ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' headerCheckAll scalafmtCheckAll ''project /'' scalafmtSbtCheck'

- name: scalaJSLink
if: matrix.project == 'rootJS'
run: 'sbt ''project ${{ matrix.project }}'' ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' Test/scalaJSLinkerResult'

- name: Test
run: 'sbt ''project ${{ matrix.project }}'' ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' test'

- name: Check binary compatibility
if: matrix.java == 'temurin@17'
run: 'sbt ''project ${{ matrix.project }}'' ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' mimaReportBinaryIssues'

- name: Generate API documentation
if: matrix.java == 'temurin@17'
run: 'sbt ''project ${{ matrix.project }}'' ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' doc'

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p target .js/target core/js/target core/jvm/target .jvm/target .native/target test-runtime/.jvm/target test-runtime/.js/target project/target

- name: Compress target directories
run: tar cf targets.tar target rootJS/target core/js/target core/jvm/target rootJVM/target test-runtime/.jvm/target test-runtime/.js/target project/target
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar target .js/target core/js/target core/jvm/target .jvm/target .native/target test-runtime/.jvm/target test-runtime/.js/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v2
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
uses: actions/upload-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.jsenv }}-${{ matrix.project }}
path: targets.tar

publish:
Expand All @@ -80,24 +147,49 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.7]
java: [temurin@11]
scala: [2.13.8]
java: [temurin@17]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java (temurin@11)
- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand All @@ -108,37 +200,148 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (3.1.0)
uses: actions/download-artifact@v2
- name: Download target directories (3.1.3, NodeJS, rootJS)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-3.1.0-${{ matrix.java }}
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-NodeJS-rootJS

- name: Inflate target directories (3.1.0)
- name: Inflate target directories (3.1.3, NodeJS, rootJS)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12.15)
uses: actions/download-artifact@v2
- name: Download target directories (3.1.3, NodeJS, rootJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-NodeJS-rootJVM

- name: Inflate target directories (2.12.15)
- name: Inflate target directories (3.1.3, NodeJS, rootJVM)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.13.7)
uses: actions/download-artifact@v2
- name: Download target directories (2.12.17, NodeJS, rootJS)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-2.13.7-${{ matrix.java }}
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-NodeJS-rootJS

- name: Inflate target directories (2.13.7)
- name: Inflate target directories (2.12.17, NodeJS, rootJS)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12.17, NodeJS, rootJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-NodeJS-rootJVM

- name: Inflate target directories (2.12.17, NodeJS, rootJVM)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.13.8, NodeJS, rootJS)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-NodeJS-rootJS

- name: Inflate target directories (2.13.8, NodeJS, rootJS)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.13.8, NodeJS, rootJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-NodeJS-rootJVM

- name: Inflate target directories (2.13.8, NodeJS, rootJVM)
run: |
tar xf targets.tar
rm targets.tar

- name: Import signing key
run: echo $PGP_SECRET | base64 -d | gpg --import
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: echo $PGP_SECRET | base64 -di | gpg --import

- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: |
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)

- name: Publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
run: sbt '++${{ matrix.scala }}' tlRelease

dependency-submission:
name: Submit Dependencies
if: github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8]
java: [temurin@17]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- run: sbt ++${{ matrix.scala }} release
- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
Loading