Skip to content

Commit fefc561

Browse files
committed
adding missed files
1 parent c470ba7 commit fefc561

25 files changed

+1169
-0
lines changed

LICENSE

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
The Okta software accompanied by this notice is provided pursuant to the
2+
following terms:
3+
4+
Copyright © 2015-2016, Okta, Inc.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
7+
this file except in compliance with the License. You may obtain a copy of the
8+
License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by
9+
applicable law or agreed to in writing, software distributed under the License
10+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11+
KIND, either express or implied. See the License for the specific language
12+
governing permissions and limitations under the License.
13+
14+
The Okta software accompanied by this notice has build dependencies on certain
15+
third party software licensed under separate terms ("Third Party Components")
16+
located in THIRD_PARTY_NOTICES.
17+
18+
19+
Apache License
20+
Version 2.0, January 2004
21+
http://www.apache.org/licenses/
22+
23+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
24+
25+
1. Definitions.
26+
27+
"License" shall mean the terms and conditions for use, reproduction, and
28+
distribution as defined by Sections 1 through 9 of this document.
29+
30+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
31+
owner that is granting the License.
32+
33+
"Legal Entity" shall mean the union of the acting entity and all other entities
34+
that control, are controlled by, or are under common control with that entity.
35+
For the purposes of this definition, "control" means (i) the power, direct or
36+
indirect, to cause the direction or management of such entity, whether by
37+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
38+
outstanding shares, or (iii) beneficial ownership of such entity.
39+
40+
You" (or "Your") shall mean an individual or Legal Entity exercising
41+
permissions granted by this License.
42+
43+
"Source" form shall mean the preferred form for making modifications, including
44+
but not limited to software source code, documentation source, and
45+
configuration files.
46+
47+
"Object" form shall mean any form resulting from mechanical transformation or
48+
translation of a Source form, including but not limited to compiled object
49+
code, generated documentation, and conversions to other media types.
50+
51+
"Work" shall mean the work of authorship, whether in Source or Object form,
52+
made available under the License, as indicated by a copyright notice that is
53+
included in or attached to the work (an example is provided in the Appendix
54+
below).
55+
56+
"Derivative Works" shall mean any work, whether in Source or Object form, that
57+
is based on (or derived from) the Work and for which the editorial revisions,
58+
annotations, elaborations, or other modifications represent, as a whole, an
59+
original work of authorship. For the purposes of this License, Derivative Works
60+
shall not include works that remain separable from, or merely link (or bind by
61+
name) to the interfaces of, the Work and Derivative Works thereof.
62+
63+
"Contribution" shall mean any work of authorship, including the original
64+
version of the Work and any modifications or additions to that Work or
65+
Derivative Works thereof, that is intentionally submitted to Licensor for
66+
inclusion in the Work by the copyright owner or by an individual or Legal
67+
Entity authorized to submit on behalf of the copyright owner. For the purposes
68+
of this definition, "submitted" means any form of electronic, verbal, or
69+
written communication sent to the Licensor or its representatives, including
70+
but not limited to communication on electronic mailing lists, source code
71+
control systems, and issue tracking systems that are managed by, or on behalf
72+
of, the Licensor for the purpose of discussing and improving the Work, but
73+
excluding communication that is conspicuously marked or otherwise designated in
74+
writing by the copyright owner as "Not a Contribution."
75+
76+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
77+
of whom a Contribution has been received by Licensor and subsequently
78+
incorporated within the Work.
79+
2. Grant of Copyright License. Subject to the terms and conditions of this
80+
License, each Contributor hereby grants to You a perpetual, worldwide,
81+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
82+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
83+
sublicense, and distribute the Work and such Derivative Works in Source or
84+
Object form.
85+
86+
3. Grant of Patent License. Subject to the terms and conditions of this
87+
License, each Contributor hereby grants to You a perpetual, worldwide,
88+
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
89+
section) patent license to make, have made, use, offer to sell, sell, import,
90+
and otherwise transfer the Work, where such license applies only to those
91+
patent claims licensable by such Contributor that are necessarily infringed by
92+
their Contribution(s) alone or by combination of their Contribution(s) with the
93+
Work to which such Contribution(s) was submitted. If You institute patent
94+
litigation against any entity (including a cross-claim or counterclaim in a
95+
lawsuit) alleging that the Work or a Contribution incorporated within the Work
96+
constitutes direct or contributory patent infringement, then any patent
97+
licenses granted to You under this License for that Work shall terminate as of
98+
the date such litigation is filed.
99+
100+
4. Redistribution. You may reproduce and distribute copies of the Work or
101+
Derivative Works thereof in any medium, with or without modifications, and in
102+
Source or Object form, provided that You meet the following conditions:
103+
104+
(a) You must give any other recipients of the Work or Derivative Works a copy
105+
of this License; and
106+
107+
(b) You must cause any modified files to carry prominent notices stating that
108+
You changed the files; and
109+
110+
(c) You must retain, in the Source form of any Derivative Works that You
111+
distribute, all copyright, patent, trademark, and attribution notices from the
112+
Source form of the Work, excluding those notices that do not pertain to any
113+
part of the Derivative Works; and
114+
115+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
116+
any Derivative Works that You distribute must include a readable copy of the
117+
attribution notices contained within such NOTICE file, excluding those notices
118+
that do not pertain to any part of the Derivative Works, in at least one of the
119+
following places: within a NOTICE text file distributed as part of the
120+
Derivative Works; within the Source form or documentation, if provided along
121+
with the Derivative Works; or, within a display generated by the Derivative
122+
Works, if and wherever such third-party notices normally appear. The contents
123+
of the NOTICE file are for informational purposes only and do not modify the
124+
License. You may add Your own attribution notices within Derivative Works that
125+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
126+
provided that such additional attribution notices cannot be construed as
127+
modifying the License.
128+
129+
You may add Your own copyright statement to Your modifications and may provide
130+
additional or different license terms and conditions for use, reproduction, or
131+
distribution of Your modifications, or for any such Derivative Works as a
132+
whole, provided Your use, reproduction, and distribution of the Work otherwise
133+
complies with the conditions stated in this License.
134+
135+
5. Submission of Contributions. Unless You explicitly state otherwise, any
136+
Contribution intentionally submitted for inclusion in the Work by You to the
137+
Licensor shall be under the terms and conditions of this License, without any
138+
additional terms or conditions. Notwithstanding the above, nothing herein shall
139+
supersede or modify the terms of any separate license agreement you may have
140+
executed with Licensor regarding such Contributions.
141+
142+
6. Trademarks. This License does not grant permission to use the trade names,
143+
trademarks, service marks, or product names of the Licensor, except as required
144+
for reasonable and customary use in describing the origin of the Work and
145+
reproducing the content of the NOTICE file.
146+
147+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
148+
writing, Licensor provides the Work (and each Contributor provides its
149+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
150+
KIND, either express or implied, including, without limitation, any warranties
151+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152+
PARTICULAR PURPOSE. You are solely responsible for determining the
153+
appropriateness of using or redistributing the Work and assume any risks
154+
associated with Your exercise of permissions under this License.
155+
156+
8. Limitation of Liability. In no event and under no legal theory, whether in
157+
tort (including negligence), contract, or otherwise, unless required by
158+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
159+
writing, shall any Contributor be liable to You for damages, including any
160+
direct, indirect, special, incidental, or consequential damages of any
161+
character arising as a result of this License or out of the use or inability to
162+
use the Work (including but not limited to damages for loss of goodwill, work
163+
stoppage, computer failure or malfunction, or any and all other commercial
164+
damages or losses), even if such Contributor has been advised of the
165+
possibility of such damages.
166+
167+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
168+
Derivative Works thereof, You may choose to offer, and charge a fee for,
169+
acceptance of support, warranty, indemnity, or other liability obligations
170+
and/or rights consistent with this License. However, in accepting such
171+
obligations, You may act only on Your own behalf and on Your sole
172+
responsibility, not on behalf of any other Contributor, and only if You agree
173+
to indemnify, defend, and hold each Contributor harmless for any liability
174+
incurred by, or claims asserted against, such Contributor by reason of your
175+
accepting any such warranty or additional liability.
176+
177+
END OF TERMS AND CONDITIONS
178+
179+
APPENDIX: How to apply the Apache License to your work.
180+
181+
To apply the Apache License to your work, attach the following boilerplate
182+
notice, with the fields enclosed by brackets "[]" replaced with your own
183+
identifying information. (Don't include the brackets!) The text should be
184+
enclosed in the appropriate comment syntax for the file format. We also
185+
recommend that a file or class name and description of purpose be included on
186+
the same "printed page" as the copyright notice for easier identification
187+
within third-party archives.

config-overrides.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/* global __dirname */
2+
/* eslint-disable import/no-extraneous-dependencies */
3+
4+
// Support storing environment variables in a file named "testenv"
5+
const path = require('path');
6+
const dotenv = require('dotenv');
7+
const fs = require('fs');
8+
9+
// Read environment variables from "testenv". Override environment vars if they are already set.
10+
const TESTENV = path.resolve(__dirname, 'testenv');
11+
if (fs.existsSync(TESTENV)) {
12+
const envConfig = dotenv.parse(fs.readFileSync(TESTENV));
13+
Object.keys(envConfig).forEach((k) => {
14+
process.env[k] = envConfig[k];
15+
});
16+
}
17+
process.env.CLIENT_ID = process.env.CLIENT_ID || process.env.SPA_CLIENT_ID;
18+
process.env.OKTA_TESTING_DISABLEHTTPSCHECK = process.env.OKTA_TESTING_DISABLEHTTPSCHECK || false;
19+
20+
const webpack = require('webpack');
21+
22+
const env = {};
23+
24+
// List of environment variables made available to the app
25+
[
26+
'ISSUER',
27+
'CLIENT_ID',
28+
'OKTA_TESTING_DISABLEHTTPSCHECK',
29+
].forEach((key) => {
30+
if (!process.env[key]) {
31+
throw new Error(`Environment variable ${key} must be set. See README.md`);
32+
}
33+
env[key] = JSON.stringify(process.env[key]);
34+
});
35+
36+
module.exports = {
37+
/* eslint-disable no-param-reassign */
38+
webpack: (config) => {
39+
// Remove the 'ModuleScopePlugin' which keeps us from requiring outside the src/ dir
40+
config.resolve.plugins = [];
41+
42+
// Define global vars from env vars (process.env has already been defined)
43+
config.plugins = config.plugins.concat([
44+
new webpack.DefinePlugin({
45+
'process.env': env,
46+
}),
47+
]);
48+
49+
config.devtool = 'source-map';
50+
config.module.rules.push({
51+
test: /\.js$/,
52+
use: ['source-map-loader'],
53+
enforce: 'pre',
54+
});
55+
56+
return config;
57+
},
58+
};

env.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Read environment variables from "testenv" in the repository root. Override environment vars if they are already set.
2+
const path = require('path');
3+
const dotenv = require('dotenv');
4+
const fs = require('fs');
5+
6+
const TESTENV = path.resolve(__dirname, '..', 'testenv');
7+
if (fs.existsSync(TESTENV)) {
8+
const envConfig = dotenv.parse(fs.readFileSync(TESTENV));
9+
Object.keys(envConfig).forEach((k) => {
10+
process.env[k] = envConfig[k];
11+
});
12+
}
13+
process.env.CLIENT_ID = process.env.CLIENT_ID || process.env.SPA_CLIENT_ID;

protractor.conf.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*!
2+
* Copyright (c) 2018, Okta, Inc. and/or its affiliates. All rights reserved.
3+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4+
*
5+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6+
* Unless required by applicable law or agreed to in writing, software
7+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
*
10+
* See the License for the specific language governing permissions and limitations under the License.
11+
*/
12+
/* eslint-disable */
13+
// Protractor configuration file, see link for more information
14+
// https://github.com/angular/protractor/blob/master/lib/config.ts
15+
16+
// Load environment variables
17+
require('./env');
18+
19+
var E2E_DIR = '../okta-oidc-tck/e2e-tests/custom-login/';
20+
var config = require(E2E_DIR + 'conf.js').config;
21+
config.specs = config.specs.map(function (path) {
22+
return E2E_DIR + path;
23+
});
24+
25+
['CLIENT_ID', 'ISSUER', 'USERNAME', 'PASSWORD'].forEach(function(key) {
26+
console.log('ENVIRONMENT VAR "' + key + '"', process.env[key]); // TODO: REMOVEME
27+
if (!process.env[key]) {
28+
throw new Error('Environment variable "' + key + '" is not set');
29+
}
30+
});
31+
32+
exports.config = config;

public/react.svg

Lines changed: 9 additions & 0 deletions
Loading

scripts/ci-build.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:: This batch file will be called by bacon CI for windows testing
2+
call npm install
3+
call npm run pretest
4+
call npm run test:e2e

scripts/e2e.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash -x
2+
3+
source ${OKTA_HOME}/${REPO}/scripts/setup.sh
4+
5+
setup_service xvfb start
6+
setup_service java 1.8.222
7+
setup_service google-chrome-stable 85.0.4183.102-1
8+
9+
yum -y install lsof
10+
11+
export TRAVIS=true
12+
export DBUS_SESSION_BUS_ADDRESS=/dev/null
13+
14+
export TEST_SUITE_TYPE="junit"
15+
export TEST_RESULT_FILE_DIR="${REPO}/build2/e2e"
16+
17+
export ISSUER=https://samples-javascript.okta.com/oauth2/default
18+
export CLIENT_ID=0oapmwm72082GXal14x6
19+
20+
get_secret prod/okta-sdk-vars/password PASSWORD
21+
22+
cd ${OKTA_HOME}/${REPO}
23+
24+
function run_tests() {
25+
exit 0;
26+
# npm run pretest
27+
# npm run test:okta-hosted-login
28+
# kill -s TERM $(lsof -t -i:8080 -sTCP:LISTEN)
29+
# npm run test:custom-login
30+
}
31+
32+
if ! run_tests; then
33+
echo "e2e tests failed! Exiting..."
34+
exit ${TEST_FAILURE}
35+
fi
36+
37+
echo ${TEST_SUITE_TYPE} > ${TEST_SUITE_TYPE_FILE}
38+
echo ${TEST_RESULT_FILE_DIR} > ${TEST_RESULT_FILE_DIR_FILE}
39+
exit ${PUBLISH_TYPE_AND_RESULT_DIR}

scripts/java-resource-server.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* eslint-disable consistent-return, no-console */
2+
3+
const fs = require('fs');
4+
const { exec } = require('child_process');
5+
const path = require('path');
6+
// Users can also provide the testenv configuration at the root folder
7+
/* eslint-disable global-require */
8+
require('dotenv').config({ path: path.join(require('os').homedir(), '.okta', 'testenv') });
9+
require('dotenv').config({ path: path.join(__dirname, '..', 'testenv') });
10+
/* eslint-disable global-require */
11+
12+
function startResourceServer() {
13+
const dir = path.join(__dirname, '..', 'samples-java-spring');
14+
if (!fs.existsSync(dir)) {
15+
console.error("[ERROR] samples-java-spring doesn't exist.");
16+
return;
17+
}
18+
19+
if (process.env.ISSUER === undefined) {
20+
console.error('[ERROR] Please set the ISSUER Environment variable');
21+
return;
22+
}
23+
24+
const command = `mvn -Dokta.oauth2.issuer=${process.env.ISSUER} -f samples-java-spring/resource-server/pom.xml`;
25+
26+
exec(command, { maxBuffer: 1024 * 2000 }, (err, stdout) => {
27+
if (err !== null) {
28+
return console.error(err);
29+
}
30+
return console.log(stdout);
31+
});
32+
}
33+
34+
startResourceServer();

0 commit comments

Comments
 (0)