Skip to content

Commit 271180e

Browse files
committed
Add WebAuthn sample application
1 parent a1bb413 commit 271180e

File tree

206 files changed

+22220
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+22220
-0
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ jdk:
66
os:
77
- linux
88

9+
dist: trusty # to use chrome
10+
11+
912
before_cache:
1013
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
1114
cache:
@@ -14,3 +17,6 @@ cache:
1417
- $HOME/.gradle/wrapper/
1518

1619
script: ./gradlew build --refresh-dependencies --no-daemon --continue
20+
21+
addons:
22+
chrome: stable

gradle/dependency-management.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ dependencyManagement {
183183
dependency 'org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final'
184184
dependency 'org.jboss:jandex:2.0.3.Final'
185185
dependency 'org.mockito:mockito-core:2.23.4'
186+
dependency 'org.modelmapper:modelmapper:0.7.8'
186187
dependency 'org.objenesis:objenesis:2.6'
187188
dependency 'org.openid4java:openid4java-nodeps:0.9.6'
188189
dependency 'org.ow2.asm:asm:6.2.1'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/registrationExtensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Spring Security WebAuthn Sample SPA Angular Client
2+
3+
Spring Security WebAuthn Sample SPA Angular Client is a client (frontend) module for Spring Security WebAuthn Sample SPA based on Angular.
4+
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"spa-angular-client": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {},
12+
"targets": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"baseHref": "/angular/",
17+
"deployUrl": "/static/angular/",
18+
"outputPath": "build/resources/main/static/angular",
19+
"index": "src/index.html",
20+
"main": "src/main.ts",
21+
"polyfills": "src/polyfills.ts",
22+
"tsConfig": "src/tsconfig.app.json",
23+
"assets": [
24+
"src/favicon.ico",
25+
"src/assets"
26+
],
27+
"styles": [
28+
"src/styles.css"
29+
],
30+
"scripts": []
31+
},
32+
"configurations": {
33+
"production": {
34+
"fileReplacements": [
35+
{
36+
"replace": "src/environments/environment.ts",
37+
"with": "src/environments/environment.prod.ts"
38+
}
39+
],
40+
"optimization": true,
41+
"outputHashing": "all",
42+
"sourceMap": false,
43+
"extractCss": true,
44+
"namedChunks": false,
45+
"aot": true,
46+
"extractLicenses": true,
47+
"vendorChunk": false,
48+
"buildOptimizer": true
49+
}
50+
}
51+
},
52+
"serve": {
53+
"builder": "@angular-devkit/build-angular:dev-server",
54+
"options": {
55+
"browserTarget": "spa-angular-client:build",
56+
"servePath": "/angular"
57+
},
58+
"configurations": {
59+
"production": {
60+
"browserTarget": "spa-angular-client:build:production"
61+
}
62+
}
63+
},
64+
"extract-i18n": {
65+
"builder": "@angular-devkit/build-angular:extract-i18n",
66+
"options": {
67+
"browserTarget": "spa-angular-client:build"
68+
}
69+
},
70+
"test": {
71+
"builder": "@angular-devkit/build-angular:karma",
72+
"options": {
73+
"main": "src/test.ts",
74+
"polyfills": "src/polyfills.ts",
75+
"tsConfig": "src/tsconfig.spec.json",
76+
"karmaConfig": "src/karma.conf.js",
77+
"styles": [
78+
"src/styles.css"
79+
],
80+
"scripts": [],
81+
"assets": [
82+
"src/favicon.ico",
83+
"src/assets"
84+
]
85+
}
86+
},
87+
"lint": {
88+
"builder": "@angular-devkit/build-angular:tslint",
89+
"options": {
90+
"tsConfig": [
91+
"src/tsconfig.app.json",
92+
"src/tsconfig.spec.json"
93+
],
94+
"exclude": [
95+
"**/node_modules/**"
96+
]
97+
}
98+
}
99+
}
100+
},
101+
"spa-angular-client-e2e": {
102+
"root": "e2e/",
103+
"projectType": "application",
104+
"targets": {
105+
"e2e": {
106+
"builder": "@angular-devkit/build-angular:protractor",
107+
"options": {
108+
"protractorConfig": "e2e/protractor.conf.js",
109+
"devServerTarget": "spa-angular-client:serve"
110+
},
111+
"configurations": {
112+
"production": {
113+
"devServerTarget": "spa-angular-client:serve:production"
114+
}
115+
}
116+
},
117+
"lint": {
118+
"builder": "@angular-devkit/build-angular:tslint",
119+
"options": {
120+
"tsConfig": "e2e/tsconfig.e2e.json",
121+
"exclude": [
122+
"**/node_modules/**"
123+
]
124+
}
125+
}
126+
}
127+
}
128+
},
129+
"defaultProject": "spa-angular-client"
130+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
plugins {
2+
id "com.moowork.node" version "1.2.0"
3+
id "java"
4+
}
5+
6+
description = "Spring Security WebAuthn Sample angular client library"
7+
8+
node {
9+
download = true
10+
11+
// Version of node to use.
12+
version = '8.12.0'
13+
14+
// Version of npm to use.
15+
npmVersion = '6.4.1'
16+
}
17+
18+
npm_run_build {
19+
args = ['--production']
20+
group = 'build'
21+
22+
}
23+
24+
npm_run_test {
25+
group = 'verification'
26+
}
27+
28+
npm_run_watchTest {
29+
group = 'verification'
30+
}
31+
32+
npm_run_e2e {
33+
group = 'verification'
34+
}
35+
36+
npm_run_start {
37+
group = 'other'
38+
}
39+
40+
/*
41+
* Copyright 2002-2019 the original author or authors.
42+
*
43+
* Licensed under the Apache License, Version 2.0 (the "License");
44+
* you may not use this file except in compliance with the License.
45+
* You may obtain a copy of the License at
46+
*
47+
* http://www.apache.org/licenses/LICENSE-2.0
48+
*
49+
* Unless required by applicable law or agreed to in writing, software
50+
* distributed under the License is distributed on an "AS IS" BASIS,
51+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
52+
* See the License for the specific language governing permissions and
53+
* limitations under the License.
54+
*/
55+
56+
// classes is a Java task
57+
classes.dependsOn npm_run_build
58+
npm_run_build.mustRunAfter processResources
59+
60+
// test is a Java task
61+
test.dependsOn npm_run_test
62+
63+
sonarqube {
64+
skipProject = true
65+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright 2002-2019 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Protractor configuration file, see link for more information
18+
// https://github.com/angular/protractor/blob/master/lib/config.ts
19+
20+
const {SpecReporter} = require('jasmine-spec-reporter');
21+
22+
exports.config = {
23+
allScriptsTimeout: 11000,
24+
specs: [
25+
'./src/**/*.e2e-spec.ts'
26+
],
27+
capabilities: {
28+
'browserName': 'chrome'
29+
},
30+
directConnect: true,
31+
baseUrl: 'http://localhost:4200/',
32+
framework: 'jasmine',
33+
jasmineNodeOpts: {
34+
showColors: true,
35+
defaultTimeoutInterval: 30000,
36+
print: function () {
37+
}
38+
},
39+
onPrepare() {
40+
require('ts-node').register({
41+
project: require('path').join(__dirname, './tsconfig.e2e.json')
42+
});
43+
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
44+
}
45+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2002-2019 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import {AppPage} from './app.po';
18+
19+
describe('workspace-project App', () => {
20+
let page: AppPage;
21+
22+
beforeEach(() => {
23+
page = new AppPage();
24+
});
25+
26+
it('should display welcome message', () => {
27+
page.navigateTo();
28+
expect(page.getParagraphText()).toEqual('Welcome to sample-client!');
29+
});
30+
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2002-2019 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import {browser, by, element} from 'protractor';
18+
19+
export class AppPage {
20+
navigateTo() {
21+
return browser.get('/');
22+
}
23+
24+
getParagraphText() {
25+
return element(by.css('app-root h1')).getText();
26+
}
27+
}

0 commit comments

Comments
 (0)