Skip to content

Commit

Permalink
remove client secret
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhartX committed Jan 3, 2021
1 parent bb44d57 commit 5a83f93
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
16 changes: 8 additions & 8 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ <h2>Logged in as: <a target="_blank" id="login-user">XXX</a></h2>
<b>repo</b> and <b>gist</b>
scope):</p>
<input id="accesstoken" type="password" placeholder="github access token" />
<p class="label"><a target="_blank"
<!-- <p class="label"><a target="_blank"
href="https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=971735641612-am059p55sofdp30p2t4djecn72l6kmpf.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/script.projects&access_type=offline">
Grant Google oauth token</a> (paste the result code here)
<br>*or leave it empty to use Chrome login user(for <b>Chrome</b> only)</p>
<input id="api-key" type="password" placeholder="google oauth token" />
<input id="api-key" type="password" placeholder="google oauth token" /> -->
</div>
<div class="login-item login-item-otp">
<input id="otp" type="text" placeholder="authentication code">
Expand All @@ -45,11 +45,11 @@ <h2>Logged in as: <a target="_blank" id="login-user">XXX</a></h2>
<input id="ghe-password" type="password" placeholder="password" />
<p class="label">or accessToken(with <b>repo</b> and <b>gist</b> scope):</p>
<input id="ghe-accesstoken" type="password" placeholder="access token" />
<p class="label"><a target="_blank"
<!-- <p class="label"><a target="_blank"
href="https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=971735641612-am059p55sofdp30p2t4djecn72l6kmpf.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/script.projects&access_type=offline">
Grant Google oauth key</a> (paste the result code here)
<br>*or leave it empty to use Chrome login user(for <b>Chrome</b> only)</p>
<input id="ghe-api-key" type="password" placeholder="google oauth token" />
<input id="ghe-api-key" type="password" placeholder="google oauth token" /> -->
</div>
<div class="login-item login-item-otp">
<input id="ghe-otp" type="text" placeholder="authentication code">
Expand All @@ -67,11 +67,11 @@ <h2>Logged in as: <a target="_blank" id="login-user">XXX</a></h2>
<div class="login-item login-item-basic">
<input id="bitbucket-email" type="email" placeholder="email" />
<input id="bitbucket-password" type="password" placeholder="password" />
<p class="label"><a target="_blank"
<!-- <p class="label"><a target="_blank"
href="https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=971735641612-am059p55sofdp30p2t4djecn72l6kmpf.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/script.projects&access_type=offline">
Grant Google oauth token</a> (paste the result code here)
<br>*or leave it empty to use Chrome login user(for <b>Chrome</b> only)</p>
<input id="bitbucket-api-key" type="password" placeholder="google oauth token" />
<input id="bitbucket-api-key" type="password" placeholder="google oauth token" /> -->
</div>
<button id="bitbucket-login">bitbucket login</button>
<p class="message">Please star this extension on <a href="https://github.com/leonhartX/gas-github">Github</a>
Expand All @@ -88,11 +88,11 @@ <h2>Logged in as: <a target="_blank" id="login-user">XXX</a></h2>
<input id="gitlab-password" type="password" placeholder="password" />
<p class="label">or personal accessToken(with <b>api</b> scope):</p>
<input id="gitlab-accesstoken" type="password" placeholder="access token" />
<p class="label"><a target="_blank"
<!-- <p class="label"><a target="_blank"
href="https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=971735641612-am059p55sofdp30p2t4djecn72l6kmpf.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/script.projects&access_type=offline">
Grant Google oauth token</a> (paste the result code here)
<br>*or leave it empty to use Chrome login user(for <b>Chrome</b> only)</p>
<input id="gitlab-api-key" type="password" placeholder="google oauth token" />
<input id="gitlab-api-key" type="password" placeholder="google oauth token" /> -->
</div>
<button id="gitlab-login">gitlab login</button>
<p class="message">Please star this extension on <a href="https://github.com/leonhartX/gas-github">Github</a>
Expand Down
14 changes: 9 additions & 5 deletions options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ function getGithubParam() {
const scm = 'github';
const username = $('#username').val();
const token = $('#accesstoken').val();
const apiKey = $('#api-key').val();
// const apiKey = $('#api-key').val();
const apiKey = null;
const baseUrl = `https://api.github.com`;
const otp = $('#otp').val();
return {
Expand All @@ -104,7 +105,8 @@ function getGHEParam() {
const username = $('#ghe-username').val();
const password = $('#ghe-password').val();
const token = $('#ghe-accesstoken').val();
const apiKey = $('#ghe-api-key').val();
// const apiKey = $('#ghe-api-key').val();
const apiKey = null;
const baseUrl = $('#ghe-url').val() + '/api/v3';
const otp = $('#ghe-otp').val();
return {
Expand All @@ -122,7 +124,8 @@ function getBitbucketParam() {
const scm = 'bitbucket';
const username = $('#bitbucket-email').val();
const password = $('#bitbucket-password').val();
const apiKey = $('#bitbucket-api-key').val();
// const apiKey = $('#bitbucket-api-key').val();
const apiKey = null;
const baseUrl = `https://api.bitbucket.org/2.0`;
return {
scm,
Expand All @@ -139,7 +142,8 @@ function getGitLabParam() {
const password = $('#gitlab-password').val();
const token = $('#gitlab-accesstoken').val();
const tokenType = (token && token.length > 0) ? 'personalToken' : 'oAuth';
const apiKey = $('#gitlab-api-key').val();
// const apiKey = $('#gitlab-api-key').val();
const apiKey = null;
const baseUrl = ($('#gitlab-url').val() || 'https://gitlab.com') + '/api/v4';
return {
scm,
Expand All @@ -164,7 +168,7 @@ function addCred(param) {
const payload = {
code: param.apiKey,
client_id: "971735641612-am059p55sofdp30p2t4djecn72l6kmpf.apps.googleusercontent.com",
client_secret: "epw3f_WvEn0Uwqi6kE7DBQl7",
client_secret: __SECRET__,
redirect_uri: "urn:ietf:wg:oauth:2.0:oob",
grant_type: "authorization_code",
access_type: "offline"
Expand Down
2 changes: 1 addition & 1 deletion src/gas/script-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class ScriptApi {
const payload = {
refresh_token: context.gapiRefreshToken,
client_id: "971735641612-am059p55sofdp30p2t4djecn72l6kmpf.apps.googleusercontent.com",
client_secret: "epw3f_WvEn0Uwqi6kE7DBQl7",
client_secret: __SECRET__,
redirect_uri: "urn:ietf:wg:oauth:2.0:oob",
grant_type: "refresh_token",
}
Expand Down

0 comments on commit 5a83f93

Please sign in to comment.