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

feat: API Authorization #251

Merged
merged 77 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
05d1077
feat: API Authorization
scarqin Mar 3, 2023
c684b0b
feat: group page
buqiyuan Mar 7, 2023
15fef5c
fix: group create
buqiyuan Mar 8, 2023
74dcd79
wip: merge main
scarqin Mar 8, 2023
5d1cdc9
fix: style
buqiyuan Mar 8, 2023
ca63a0a
build: change dir location
scarqin Mar 8, 2023
265e95d
build: change dir location
scarqin Mar 8, 2023
5335ac8
fix: paths
buqiyuan Mar 8, 2023
04daa2c
build: path error
scarqin Mar 8, 2023
b67ae2d
fix: windows app download path
buqiyuan Mar 8, 2023
1cba23f
chore: merge code
buqiyuan Mar 8, 2023
6f1b8f6
feat: authAPI
buqiyuan Mar 8, 2023
c729a44
fix: schema-form description style
buqiyuan Mar 8, 2023
7f65746
feat: schema-form support checkbox textarea
buqiyuan Mar 8, 2023
bd9be85
fix: tab panel style
buqiyuan Mar 8, 2023
74b9127
wip: stash data
scarqin Mar 8, 2023
e51a331
feat: add api testing category
buqiyuan Mar 9, 2023
2f0c64a
feat: save group auth
buqiyuan Mar 9, 2023
c266edd
fix: some thing
buqiyuan Mar 9, 2023
d14b6e1
fix: monaco-edit load path error
buqiyuan Mar 9, 2023
c0d6df3
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
scarqin Mar 9, 2023
fcbab5f
fix: get auth from test history
buqiyuan Mar 10, 2023
d2ac527
fix: isFormChange
buqiyuan Mar 10, 2023
2010e31
wip: merge main
scarqin Mar 10, 2023
3f48c99
fix: some thing
buqiyuan Mar 10, 2023
16d383f
feat: extensions-manage
scarqin Mar 10, 2023
ba45a59
fix: empty test page auth error
buqiyuan Mar 10, 2023
dba8657
fix: init empty map for authAPIMap
buqiyuan Mar 10, 2023
fec300d
style: fix group padding
scarqin Mar 10, 2023
dd8bdf9
feat(test-server): init runtime
scarqin Mar 13, 2023
350873d
chore(throw-error): error handler catch all error but not throw
scarqin Mar 13, 2023
4bf7088
wip: stach
scarqin Mar 13, 2023
77aaa50
feat(test-server): add script-engines postman
scarqin Mar 13, 2023
ebc9d1c
wip: add extension manage
scarqin Mar 13, 2023
65564d5
refactor: authorization
buqiyuan Mar 14, 2023
a3379b1
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
buqiyuan Mar 14, 2023
bf5ecfe
fix: group query
buqiyuan Mar 14, 2023
d6ec50e
fix: group read
buqiyuan Mar 14, 2023
c3f865e
fix: api test auth list
buqiyuan Mar 14, 2023
23e939c
chore: rebuild file structure
scarqin Mar 14, 2023
5ebd25d
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
scarqin Mar 14, 2023
28f8ef5
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
scarqin Mar 14, 2023
c0570c1
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
scarqin Mar 14, 2023
1981ac7
chore: merge code
buqiyuan Mar 14, 2023
15bce96
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
buqiyuan Mar 14, 2023
894ee04
wip: debug auth extension
scarqin Mar 14, 2023
fe46455
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
buqiyuan Mar 14, 2023
1689cec
fix: error
scarqin Mar 14, 2023
5a1d5f5
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
buqiyuan Mar 14, 2023
648a838
feat: debug extension at node
scarqin Mar 14, 2023
400cd4b
fix: compile error
scarqin Mar 14, 2023
8a08e6e
refactor: group auth
buqiyuan Mar 14, 2023
ccec307
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
buqiyuan Mar 14, 2023
6f3d887
feat: for merge
scarqin Mar 14, 2023
c113c6e
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
scarqin Mar 14, 2023
83585a9
fix: some bug
buqiyuan Mar 14, 2023
c604967
fix: delete group shoud close page
buqiyuan Mar 14, 2023
708f70b
feat: group shard
buqiyuan Mar 14, 2023
7b32d17
fix: some bug
buqiyuan Mar 14, 2023
c0d5ed2
fix: some bug
buqiyuan Mar 14, 2023
4ccef23
feat: translate
scarqin Mar 14, 2023
370e784
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
scarqin Mar 14, 2023
da78748
fix: some bug
buqiyuan Mar 14, 2023
7eeb814
fix: api test error
scarqin Mar 14, 2023
5494f6e
wip: merge
scarqin Mar 14, 2023
507eb58
fix: some bug
buqiyuan Mar 14, 2023
54d76ba
fix: some bug
buqiyuan Mar 14, 2023
62182bc
fix: some bug
buqiyuan Mar 14, 2023
8822d45
perf(api-group): group select status
scarqin Mar 14, 2023
6a75629
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
scarqin Mar 14, 2023
01a254b
fix: delete group shoud delete all sub group
buqiyuan Mar 14, 2023
1af4bc7
fix: share page
buqiyuan Mar 14, 2023
3959f36
fix(api-test): form-data test error
scarqin Mar 14, 2023
1214061
fix: share page
buqiyuan Mar 14, 2023
bb36a69
Merge branch 'feat/api-authorization' of github.com:Postcatlab/postca…
scarqin Mar 14, 2023
d8ed08a
Merge remote-tracking branch 'origin' into feat/api-authorization
scarqin Mar 14, 2023
9bf3ecf
build(e2e): delete image
scarqin Mar 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
_cli-tpl/
dist/
coverage/
src/node

# Logs
logs
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ out/
/release
*.js
*.js.map
*.webpack.js
!patches/*
!src/workbench/node/electron/**/*.js
!src/workbench/node/request/**/*.js
!src/workbench/node/server/**/*.js
!src/node/**/*.js
!/api/*.js
!/scripts/**/*.js
!*.config.js
Expand Down
1,218 changes: 484 additions & 734 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ yarn start

```shell

cd src/workbench/browser&&npm install
cd src/browser&&npm install

yarn start

Expand Down
14 changes: 7 additions & 7 deletions api/unit.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
let _LibsFlowCommon = require('../src/workbench/node/request/unit.js');
let _LibsCommon = require('../src/workbench/node/request/libs/common.js');
let _LibsFlowCommon = require('../src/node/test-server/request/unit.js');
let _LibsCommon = require('../src/node/test-server/request/libs/common.js');

module.exports = (req, res) => {
console.log('unit.js', req.body);
try {
let reqJSON = req.body.data;
reqJSON.env = _LibsCommon.parseEnv(reqJSON.env);
new _LibsFlowCommon.core().main(reqJSON).then(({ globals,report, history }) => {
['general', 'requestInfo', 'resultInfo'].forEach((keyName) => {
new _LibsFlowCommon.core().main(reqJSON).then(({ globals, report, history }) => {
['general', 'requestInfo', 'resultInfo'].forEach(keyName => {
if (typeof history[keyName] === 'string') history[keyName] = JSON.parse(history[keyName]);
});
res.send(
JSON.stringify({
action: 'finish',
data: {
id: req.body.id,
globals:globals,
globals: globals,
report: report,
history: history,
},
history: history
}
})
);
});
Expand Down
4 changes: 2 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
files:
- source: /src/workbench/browser/src/locale/messages.xlf
translation: /src/workbench/browser/src/locale/messages.%two_letters_code%.xlf
- source: /src/browser/src/locale/messages.xlf
translation: /src/browser/src/locale/messages.%two_letters_code%.xlf
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
2 changes: 1 addition & 1 deletion donkey.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const baseUrl = './src/workbench/browser/src/app/shared/services/storage/';
const baseUrl = './src/browser/src/app/shared/services/storage/';
module.exports = {
entry: {
// target: ["./test/apiData.ts", "./test/env.ts"]
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "postcat",
"version": "0.3.2",
"version": "0.4.0",
"main": "out/app/electron-main/main.js",
"description": "A lightweight, extensible API tool",
"homepage": "https://github.com/Postcatlab/postcat.git",
"author": "Postcat",
"private": true,
"workspaces": [
"src/workbench/*"
"src/node/*",
"src/browser"
],
"scripts": {
"prepare": "husky install && electron-builder install-app-deps && node ./scripts/afterInstall.js && npx patch-package",
Expand Down Expand Up @@ -108,7 +109,7 @@
},
"__npminstall_done": false,
"node-module-alias": {
"eo": "./out"
"pc": "./out"
},
"lint-staged": {
"*.{js,ts}": [
Expand Down
6 changes: 3 additions & 3 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ const config: Configuration = {
'out/platform/**/*.js*',
'out/environment.js',
'out/shared/**/*.js*',
'src/workbench/browser/dist/**/*',
'out/workbench/browser/src/**/*.js*',
'out/workbench/node/**/*.js*',
'src/browser/dist/**/*',
'out/browser/src/**/*.js*',
'out/node/test-server/**/*.js*',
'out/app/common/**/*',
'!**/*.ts'
],
Expand Down
6 changes: 3 additions & 3 deletions scripts/buildNoSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const config: Configuration = {
'out/platform/**/*.js*',
'out/environment.js',
'out/shared/**/*.js*',
'src/workbench/browser/dist/**/*',
'out/workbench/browser/src/**/*.js*',
'out/workbench/node/**/*.js*',
'src/browser/dist/**/*',
'out/browser/src/**/*.js*',
'out/node/test-server/**/*.js*',
'out/app/common/**/*',
'!**/*.ts'
],
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/replaceCssVariable.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const variables = {
'--MARGIN': '--margin',
'--MR_ICON': '--button-icon-margin'
};
searchFilesInDirectoryAsync(['../src/workbench/browser/src'], sortByKeylength(variables));
searchFilesInDirectoryAsync(['../src/browser/src'], sortByKeylength(variables));
//Lazy to await
setTimeout(() => {
console.log('Replaced Success!\n', replaceSuccess);
Expand Down
4 changes: 2 additions & 2 deletions scripts/tools/upgradeComponent.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//If stuck,check yarn.lock file,maybe has conflict
// upgrade.js
const child_process = require('child_process');
const pkg = require('../src/workbench/browser/package.json');
const pkg = require('../../src/browser/package.json');
const filterRegex = /eo-ng-.*/;

const dependencies = pkg['dependencies'];
const dependencyList = Object.keys(dependencies).filter(dependency => filterRegex.test(dependency));
child_process.execSync(`cd ../src/workbench/browser&&yarn upgrade ${dependencyList.join('@latest ')}@latest`);
child_process.execSync(`cd ../../src/browser&&yarn upgrade ${dependencyList.join('@latest ')}@latest`);
2 changes: 1 addition & 1 deletion src/app/electron-main/language.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { app } from 'electron';
import Store from 'electron-store';

import { LANGUAGES } from '../../workbench/browser/src/app/core/services/language/language.model';
import { LANGUAGES } from '../../browser/src/app/core/services/language/language.model';
const store = new Store();
class LanguageInstance {
private static _instance: LanguageInstance;
Expand Down
10 changes: 5 additions & 5 deletions src/app/electron-main/main.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
require('@bqy/node-module-alias/register');
import { app, BrowserWindow, ipcMain } from 'electron';
import Store from 'electron-store';
import { LanguageService } from 'eo/app/electron-main/language.service';
import { MockServer } from 'eo/platform/node/mock-server';
import { LanguageService } from 'pc/app/electron-main/language.service';
import { MockServer } from 'pc/platform/node/mock-server';
import portfinder from 'portfinder';

import { UnitWorkerModule } from '../../node/test-server/electron/main';
import socket from '../../node/test-server/server/socketio';
import { processEnv } from '../../platform/node/constant';
import { ModuleManager } from '../../platform/node/extension-manager/manager';
import { proxyOpenExternal } from '../../shared/common/browserView';
import { UnitWorkerModule } from '../../workbench/node/electron/main';
import socket from '../../workbench/node/server/socketio';
import { EoUpdater } from './updater';

import * as os from 'os';
Expand Down Expand Up @@ -98,7 +98,7 @@ class EoBrowserWindow {
const file: string =
processEnv === 'development'
? 'http://localhost:4200'
: `file://${path.join(__dirname, `../../../src/workbench/browser/dist/${await LanguageService.getPath()}/index.html`)}`;
: `file://${path.join(__dirname, `../../../src/browser/dist/${await LanguageService.getPath()}/index.html`)}`;
this.win.loadURL(file);
if (['development'].includes(processEnv)) {
this.win.webContents.openDevTools({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/workbench/browser/.gitignore → src/browser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ src/**/*.js
!src/karma.conf.js
!src/assets/font/*.js
!src/assets/libs/*.js
!build/*.js
*.js.map

!*.webpack.js

# dependencies
node_modules
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"src/icon.ico",
"src/assets",
"src/extensions",
{ "glob": "**/*", "input": "../../../node_modules/monaco-editor/min/vs", "output": "/assets/vs/" }
{ "glob": "**/*", "input": "../../node_modules/monaco-editor/min/vs", "output": "/assets/vs/" }
],
"styles": ["src/styles/antd.less", "src/styles.scss"],
"scripts": ["src/assets/libs/protocolcheck.js"],
Expand Down
File renamed without changes.
Loading