Skip to content

Commit 414bc6e

Browse files
committed
feat: first commit
0 parents  commit 414bc6e

Some content is hidden

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

57 files changed

+12368
-0
lines changed

.eslintrc.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2020": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/eslint-recommended",
9+
"plugin:@typescript-eslint/recommended"
10+
],
11+
"parser": "@typescript-eslint/parser",
12+
"parserOptions": {
13+
"ecmaVersion": 11
14+
},
15+
"plugins": ["@typescript-eslint"],
16+
"ignorePatterns": ["dist/*"]
17+
}

.gitignore

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18+
.grunt
19+
20+
# node-waf configuration
21+
.lock-wscript
22+
23+
# Compiled binary addons (http://nodejs.org/api/addons.html)
24+
build/Release
25+
26+
# Dependency directories
27+
node_modules
28+
jspm_packages
29+
30+
# Optional npm cache directory
31+
.npm
32+
33+
# Optional REPL history
34+
.node_repl_history
35+
36+
#Ignores for Typescript and wwwroot project
37+
node_modules
38+
typings
39+
40+
# js stuff (we use typescript)
41+
*.js
42+
*.map
43+
*.d.ts
44+
45+
# dist folder
46+
dist/
47+
48+
*.zip
49+
*.tgz
50+

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": false
4+
}

.vscode/launch.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// Use IntelliSense to learn about possible Node.js debug attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Mocha Tests",
11+
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
12+
"protocol": "inspector",
13+
"args": [
14+
"-u",
15+
"tdd",
16+
"--timeout",
17+
"999999",
18+
"--colors",
19+
"${workspaceRoot}/test"
20+
],
21+
"internalConsoleOptions": "openOnSessionStart",
22+
"env": {
23+
"DEBUG": "*,-not_this"
24+
}
25+
}
26+
]
27+
}

.vscode/settings.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"files.exclude": {
3+
"**/.git": true,
4+
"**/.DS_Store": true,
5+
"**/*.js": {
6+
"when": "$(basename).ts"
7+
},
8+
"**/*.js.map": {
9+
"when": "$(basename)"
10+
},
11+
"**/*.d.ts": {
12+
"when": "$(basename).ts"
13+
}
14+
},
15+
"typescript.tsdk": "./node_modules/typescript/lib"
16+
}

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# MindSphere Authorization Helper Chrome Extension
2+
3+
## Simplify MindSphere Authentication During Development

assets/css/styles.css

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/** @format */
2+
3+
#_mdspcontent {
4+
margin-top: 25px;
5+
font-size: 21px;
6+
text-align: center;
7+
animation: fadein 2s;
8+
-moz-animation: fadein 2s; /* Firefox */
9+
-webkit-animation: fadein 2s; /* Safari and Chrome */
10+
-o-animation: fadein 2s; /* Opera */
11+
}
12+
@keyframes fadein {
13+
from {
14+
opacity: 0;
15+
}
16+
to {
17+
opacity: 1;
18+
}
19+
}
20+
@-moz-keyframes fadein {
21+
/* Firefox */
22+
from {
23+
opacity: 0;
24+
}
25+
to {
26+
opacity: 1;
27+
}
28+
}
29+
@-webkit-keyframes fadein {
30+
/* Safari and Chrome */
31+
from {
32+
opacity: 0;
33+
}
34+
to {
35+
opacity: 1;
36+
}
37+
}
38+
@-o-keyframes fadein {
39+
/* Opera */
40+
from {
41+
opacity: 0;
42+
}
43+
to {
44+
opacity: 1;
45+
}
46+
}
1.17 KB
Loading

assets/images/logo-128.png

3.89 KB
Loading

assets/images/logo-16.png

605 Bytes
Loading

assets/images/logo-32.png

1.1 KB
Loading

assets/images/logo-48.png

1.91 KB
Loading

assets/images/logo-64.png

2 KB
Loading

dist.crx

672 KB
Binary file not shown.

index.html

+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
<!-- @format -->
2+
3+
<html>
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link
7+
href="https://static.eu1.mindsphere.io/mdsp-css/v1.3.0/css/mdsp-css.min.css"
8+
rel="stylesheet"
9+
/>
10+
<link
11+
href="https://static.eu1.mindsphere.io/osbar/v4/css/mdspstyles.4.9.1.min.css"
12+
rel="stylesheet"
13+
/>
14+
<link rel="stylesheet" href="assets/css/styles.css" />
15+
<link rel="stylesheet" href="vendor/font-awesome-4.7.0/css/font-awesome.min.css" />
16+
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
17+
<title>MindSphere Authorization Helper</title>
18+
19+
<template id="listItem">
20+
<li class="list__item">
21+
<div class="item__content">
22+
<div
23+
class="content__column content__column--primary has-default-width-20 xs-100 sm-66 md-33 lg-20 xl-20"
24+
>
25+
<p title="HOST" class="item__title">
26+
{{domain}}
27+
<a href="https://{{domain}}" title="Reload Application" target="_new">
28+
<i class="fa fa-external-link has-color-accentBlueDark"></i>
29+
</a>
30+
</p>
31+
<p
32+
data="{{session}}"
33+
title="SESSION (Click to Show)"
34+
class="item__title has-color-contextBlue600"
35+
style="cursor: pointer;"
36+
>
37+
{{sessionShort}}
38+
</p>
39+
<p
40+
data="{{xsrftoken}}"
41+
title="XSRF-TOKEN (Click to Show)"
42+
class="item__title has-color-forced-contextGreen600"
43+
style="cursor: pointer;"
44+
>
45+
{{xsrftokenShort}}
46+
</p>
47+
<div class="item__description">
48+
<button
49+
data="{{linux}}"
50+
class="button--primary"
51+
title="Copy Environment Variables for Bash to Clipboard"
52+
>
53+
<i class="fa fa-clipboard has-color-forced-accentBlueDark"></i> Bash
54+
</button>
55+
<button
56+
data="{{cmd}}"
57+
class="button--primary"
58+
title="Copy Environment Variables for CMD to Clipboard"
59+
>
60+
<i class="fa fa-clipboard has-color-accentRedDark"></i> CMD
61+
</button>
62+
63+
<button
64+
data="{{ps}}"
65+
class="button--primary"
66+
title="Copy Environment Variables for PowerShell to Clipboard"
67+
>
68+
<i class="fa fa-clipboard has-color-accentYellowDark"></i> PS
69+
</button>
70+
<button
71+
data="{{sessionraw}}"
72+
class="button--primary"
73+
title="Copy SESSION Cookie to Clipboard"
74+
>
75+
<i class="fa fa-clipboard has-color-contextBlue600"> </i> Session
76+
</button>
77+
<button
78+
data="{{xsrftokenraw}}"
79+
class="button--primary"
80+
title="Copy XSRF-TOKEN Cookie to Clipboard"
81+
>
82+
<i class="fa fa-clipboard has-color-contextGreen600"> </i> Xsrf
83+
</button>
84+
</div>
85+
</div>
86+
</div>
87+
</li>
88+
</template>
89+
</head>
90+
91+
<body>
92+
<osbar-root id="_mdspbar" ng-version="6.0.6">
93+
<mdsp-home-link
94+
><a href="#">
95+
<img
96+
src="assets/images/authentication-helper.png"
97+
style="height: 24px; margin: 6px;"
98+
/> </a
99+
></mdsp-home-link>
100+
<div
101+
data-mdsp-e2e="osbar_dropdownWrapper"
102+
class="_mdsp-dropdownWrapper _mdsp-tenantInfo text"
103+
>
104+
<a data-mdsp-e2e="osbar_dropdownLinkEnabled"
105+
><span class="dropdown-link-enabled">MindSphere Cookies&nbsp;</span></a
106+
>
107+
</div>
108+
109+
<div id="_mdsp-filler"></div>
110+
<mdsp-operator-type>
111+
<div id="_mdsp-operatorType">
112+
<div class="_mdsp-operatorType__innerWrap">
113+
auth
114+
</div>
115+
</div>
116+
</mdsp-operator-type>
117+
</osbar-root>
118+
119+
<div
120+
class="mdsp mdsp-defaults"
121+
id="_mdspcontent"
122+
style="
123+
min-width: 500px;
124+
min-height: 500px;
125+
margin-left: 10px;
126+
margin-right: 10px;
127+
text-align: left;
128+
"
129+
>
130+
<div class="emptyState">
131+
<div class="emptyState__visual">
132+
<i class="fa fa-certificate fa-2x"></i>
133+
</div>
134+
135+
<h2 class="emptyState__title">
136+
You don't have any MindSphere Cookies
137+
</h2>
138+
<div class="emptyState__description">
139+
Please login to your tenant to start borrowing cookies for the development tools.
140+
</div>
141+
</div>
142+
<div class="list" style="text-align: left !important;">
143+
<ul class="list__list" id="cookieList"></ul>
144+
</div>
145+
<div
146+
class="has-color-forced-gray400"
147+
style="margin-top: 5px; font-size: 14px; text-align: right;"
148+
>
149+
<p>
150+
treat the authentication cookies like your credentials<br />and use them only in secure
151+
environments
152+
</p>
153+
<a
154+
class="has-color-forced-gray250"
155+
style="text-decoration: none;"
156+
title="License"
157+
href="https://opensource.mindsphere.io/docs/mindsphere-auth-helper/LICENSE.html"
158+
target="_new"
159+
>
160+
License (MIT) <i class="fa fa-legal"></i
161+
></a>
162+
<a
163+
class="has-color-forced-gray250"
164+
style="text-decoration: none;"
165+
title="Source Code"
166+
href="https://github.com/mindsphere-auth-helper/index.html"
167+
target="_new"
168+
>github <i class="fa fa-github"></i
169+
></a>
170+
<a
171+
class="has-color-forced-gray250"
172+
style="text-decoration: none;"
173+
title="Documentation"
174+
href="https://opensource.mindsphere.io/docs/mindsphere-auth-helper/index.html"
175+
target="_new"
176+
>opensource.mindsphere.io <i class="fa fa-external-link"></i
177+
></a>
178+
</div>
179+
</div>
180+
181+
<script type="module" src="./scripts.js" type="text/javascript"></script>
182+
</body>
183+
</html>

manifest.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "MindSphere Authentication Helper Extension",
3+
"version": "1.0.0",
4+
"description": "Borrow the SESSION and XSTF-TOKEN cookie from MindSphere for local development and command line tools.",
5+
"author": "@sn0wcat",
6+
"permissions": ["cookies", "https://*.mindsphere.io/*", "https://*.mindsphere-in.cn/*"],
7+
"icons": {
8+
"16": "assets/images/logo-16.png",
9+
"32": "assets/images/logo-32.png",
10+
"48": "assets/images/logo-48.png",
11+
"128": "assets/images/logo-128.png"
12+
},
13+
"background": {},
14+
"browser_action": {
15+
"default_popup": "index.html",
16+
"default_icon": {
17+
"16": "assets/images/logo-16.png",
18+
"32": "assets/images/logo-32.png",
19+
"48": "assets/images/logo-48.png",
20+
"128": "assets/images/logo-128.png"
21+
}
22+
},
23+
"content_security_policy": "script-src 'self' https://static.eu1.mindsphere.io; object-src 'self'",
24+
"manifest_version": 2
25+
}

0 commit comments

Comments
 (0)