This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new 688c6d99b [FIX] sso login patch (#2841)
688c6d99b is described below
commit 688c6d99b2c34afc8927a21ad02f8fa0a12e53a8
Author: Leomax_Sun <[email protected]>
AuthorDate: Sat Jul 8 18:12:24 2023 +0800
[FIX] sso login patch (#2841)
* [FIX] sso login prompt bug
* [FIX] add sso config for helm chart
---------
Co-authored-by: asuiah <[email protected]>
---
.../streampark-console-config/application-sso.yml | 26 ++++++++++++++++++++++
.../conf/streampark-console-config/application.yml | 9 +++++++-
.../src/main/resources/application.yml | 2 +-
.../src/api/system/passport.ts | 16 ++++++++++---
.../src/views/flink/app/Add.vue | 25 ++-------------------
.../src/views/flink/resource/View.vue | 3 ---
.../views/flink/resource/components/Resource.vue | 5 -----
.../src/views/setting/FlinkGateway/index.vue | 2 +-
8 files changed, 51 insertions(+), 37 deletions(-)
diff --git
a/deploy/helm/streampark/conf/streampark-console-config/application-sso.yml
b/deploy/helm/streampark/conf/streampark-console-config/application-sso.yml
new file mode 100644
index 000000000..48ce3435b
--- /dev/null
+++ b/deploy/helm/streampark/conf/streampark-console-config/application-sso.yml
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+pac4j:
+ callbackUrl: http://localhost:10000/callback
+ # Put all parameters under `properties`
+ # Check supported sso config parameters for different authentication clients
from the below link
+ #
https://github.com/pac4j/pac4j/blob/master/documentation/docs/config-module.md
+ properties:
+ principalNameAttribute:
+ # Optional, change by authentication client
+ # Please replace and fill in your client config below when enabled SSO
diff --git
a/deploy/helm/streampark/conf/streampark-console-config/application.yml
b/deploy/helm/streampark/conf/streampark-console-config/application.yml
index 309e7e6af..d4b6a1ed5 100755
--- a/deploy/helm/streampark/conf/streampark-console-config/application.yml
+++ b/deploy/helm/streampark/conf/streampark-console-config/application.yml
@@ -44,7 +44,10 @@ springdoc:
packages-to-scan: org.apache.streampark.console
spring:
- profiles.active: h2 #[h2,pgsql,mysql]
+ profiles:
+ active: h2 #[h2,pgsql,mysql]
+ # Please uncomment the below config if enable sso
+ # include: sso
application.name: StreamPark
devtools.restart.enabled: false
mvc.pathmatch.matching-strategy: ant_path_matcher
@@ -144,3 +147,7 @@ ldap:
user:
identity-attribute: uid
email-attribute: mail
+
+sso:
+ # If turn to true, please provide the sso properties the application-sso.yml
+ enable: false
diff --git
a/streampark-console/streampark-console-service/src/main/resources/application.yml
b/streampark-console/streampark-console-service/src/main/resources/application.yml
index e2c7dd198..d4b6a1ed5 100644
---
a/streampark-console/streampark-console-service/src/main/resources/application.yml
+++
b/streampark-console/streampark-console-service/src/main/resources/application.yml
@@ -92,7 +92,7 @@ streampark:
# lark alert proxy,default https://open.feishu.cn
lark-url:
yarn:
- # default sample, or kerberos
+ # default sample, or kerberos
http-auth: sample
# HADOOP_USER_NAME
diff --git
a/streampark-console/streampark-console-webapp/src/api/system/passport.ts
b/streampark-console/streampark-console-webapp/src/api/system/passport.ts
index f6428a286..468f3927d 100644
--- a/streampark-console/streampark-console-webapp/src/api/system/passport.ts
+++ b/streampark-console/streampark-console-webapp/src/api/system/passport.ts
@@ -50,7 +50,17 @@ export function fetchSignType(): Promise<String[]> {
}
export function fetchSsoToken(): Promise<LoginResultModel> {
- return defHttp.get({
- url: Api.SSO_TOKEN,
- });
+ return defHttp.get(
+ {
+ url: Api.SSO_TOKEN,
+ },
+ {
+ errorMessageMode: 'none',
+ retryRequest: {
+ isOpenRetry: false,
+ count: 1,
+ waitTime: 100,
+ },
+ },
+ );
}
diff --git
a/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
b/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
index 7df480ec1..7b1c8b197 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
@@ -22,7 +22,7 @@
<script setup lang="ts" name="AppCreate">
import { useGo } from '/@/hooks/web/usePage';
import ProgramArgs from './components/ProgramArgs.vue';
- import { Switch, Alert } from 'ant-design-vue';
+ import { Switch } from 'ant-design-vue';
import { onMounted, reactive, ref, unref } from 'vue';
import { PageWrapper } from '/@/components/Page';
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
@@ -32,8 +32,7 @@
import { useDrawer } from '/@/components/Drawer';
import Mergely from './components/Mergely.vue';
import { handleConfTemplate } from '/@/api/flink/config';
- import UploadJobJar from './components/UploadJobJar.vue';
- import { fetchAppConf, fetchCreate, fetchMain, fetchUpload } from
'/@/api/flink/app/app';
+ import { fetchAppConf, fetchCreate } from '/@/api/flink/app/app';
import options from './data/option';
import { useCreateSchema } from './hooks/useCreateSchema';
import { getAppConfType, handleSubmitParams } from './utils';
@@ -64,8 +63,6 @@
const go = useGo();
const flinkSql = ref();
const dependencyRef = ref();
- const uploadLoading = ref(false);
- const uploadJar = ref('');
const submitLoading = ref(false);
const { t } = useI18n();
@@ -131,24 +128,6 @@
}
}
- /* Custom job upload */
- async function handleCustomJobRequest(data) {
- const formData = new FormData();
- formData.append('file', data.file);
- try {
- const path = await fetchUpload(formData);
- uploadJar.value = data.file.name;
- const res = await fetchMain({
- jar: path,
- });
- uploadLoading.value = false;
- setFieldsValue({ mainClass: res });
- } catch (error) {
- console.error(error);
- uploadLoading.value = false;
- }
- }
-
function handleEditConfClose() {
const formValue = getFieldsValue();
if (!formValue.configOverride) {
diff --git
a/streampark-console/streampark-console-webapp/src/views/flink/resource/View.vue
b/streampark-console/streampark-console-webapp/src/views/flink/resource/View.vue
index 09390c249..0cae4e79e 100644
---
a/streampark-console/streampark-console-webapp/src/views/flink/resource/View.vue
+++
b/streampark-console/streampark-console-webapp/src/views/flink/resource/View.vue
@@ -112,15 +112,12 @@
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import Icon from '/@/components/Icon';
- import { useRouter } from 'vue-router';
import { fetchResourceDelete, fetchResourceList, fetchTeamResource } from
'/@/api/flink/resource';
import { EngineTypeEnum, ResourceTypeEnum } from
'/@/views/flink/resource/resource.data';
import { Tag } from 'ant-design-vue';
const teamResource = ref<Array<any>>([]);
- const router = useRouter();
const [registerDrawer, { openDrawer }] = useDrawer();
- const [registerInfo, { openDrawer: openInfoDraw }] = useDrawer();
const { createMessage } = useMessage();
const { t } = useI18n();
const [registerTable, { reload }] = useTable({
diff --git
a/streampark-console/streampark-console-webapp/src/views/flink/resource/components/Resource.vue
b/streampark-console/streampark-console-webapp/src/views/flink/resource/components/Resource.vue
index d9fa91b9f..7c6db92e2 100644
---
a/streampark-console/streampark-console-webapp/src/views/flink/resource/components/Resource.vue
+++
b/streampark-console/streampark-console-webapp/src/views/flink/resource/components/Resource.vue
@@ -16,7 +16,6 @@
-->
<script lang="ts">
import { defineComponent, onMounted, reactive, ref } from 'vue';
- import { useI18n } from '/@/hooks/web/useI18n';
import { toPomString } from '/@/views/flink/app/utils/Pom';
export default defineComponent({
@@ -29,10 +28,8 @@
import { Icon } from '/@/components/Icon';
import { useMonaco } from '/@/hooks/web/useMonaco';
import { Tabs, Alert, Tag, Space } from 'ant-design-vue';
- import { useMessage } from '/@/hooks/web/useMessage';
import { fetchUpload } from '/@/api/flink/app/app';
import UploadJobJar from '/@/views/flink/app/components/UploadJobJar.vue';
- import { onMounted } from 'vue';
interface DependencyType {
artifactId: string;
@@ -64,9 +61,7 @@
required: true,
},
});
- const { t } = useI18n();
const defaultValue = '';
- const { Swal } = useMessage();
const { onChange, setContent } = useMonaco(pomBox, {
language: 'xml',
code: props.value || defaultValue,
diff --git
a/streampark-console/streampark-console-webapp/src/views/setting/FlinkGateway/index.vue
b/streampark-console/streampark-console-webapp/src/views/setting/FlinkGateway/index.vue
index f0b582ccf..9bf2d1347 100644
---
a/streampark-console/streampark-console-webapp/src/views/setting/FlinkGateway/index.vue
+++
b/streampark-console/streampark-console-webapp/src/views/setting/FlinkGateway/index.vue
@@ -46,7 +46,7 @@
</PageWrapper>
</template>
<script lang="ts">
- import { defineComponent, unref } from 'vue';
+ import { defineComponent } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import FlinkGatewayDrawer from './components/FlinkGatewayDrawer.vue';