Skip to content

Commit

Permalink
tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Aug 18, 2023
1 parent 1c97386 commit 7cf16ed
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 83 deletions.
53 changes: 0 additions & 53 deletions dashboard/pkg/epinio/dialog/LoginDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Tab from '@shell/components/Tabbed/Tab.vue';
import epinioAuth, { EpinioAuthTypes } from '../utils/auth';
import Password from '@shell/components/form/Password';
import { LabeledInput } from '@components/Form/LabeledInput';
// import { EpinioCluster } from '../utils/epinio-discovery';
export default {
name: 'LoginDialog',
Expand All @@ -32,17 +31,6 @@ export default {
},
methods: {
// async loginWrapper(buttonDone) {
// try {
// await this.login(buttonDone);
// this.close();
// } catch (err) {
// console.error(err); // eslint-disable-line
// this.errors = epinioExceptionToErrorsArray(err);
// buttonDone(false);
// }
// },
async login() {
const cluster = this.resources[0];
const errors = [];
Expand Down Expand Up @@ -71,22 +59,6 @@ export default {
break;
}
// TODO: RC behaviour
// Local User credentials do not persist over refresh. Refreshing on an epinio page will redirect the user to the epinio list
// Dex User credentials are stored in sessions storage so do persist over refresh
// If the user wants to log out, either to remove the current visits local user or the session storage dex credentials, they can log out in the epinio list
// Discussion - If the user logs out of Rancher should they also be logged out of all epinio clusters?
// TODO: RC test refresh on cluster when dex, local user
// TODO: RC test switching between clustes
// TODO: RC auto refresh token on expirer? silent refresh?
// this.dexUserManager.events.addSilentRenewError
// this.manager.events.addAccessTokenExpiring(() => { console.log('token expiring'); this.manager.signinSilent({ extraTokenParams: { appId: 123, domain: 'abc.com' } }).then(user => { }).catch(e => { }); });
// automaticSilentRenew: true,
// silent_redirect_uri: `${window.location.origin}/assets/silent-callback.html`
// TODO: RC document epinio setup
// TODO: RC create issue epinio /endpoint to determine enabled auth endpoints (aka show dex) and also to get epinio version
cluster.loggedIn = true;
this.$router.push({
Expand Down Expand Up @@ -167,31 +139,6 @@ export default {
</Tab>
</Tabbed>
</template>

<!-- <div
slot="actions"
class="bottom"
>
<Banner
v-for="(err, i) in errors"
:key="i"
color="error"
:label="err"
/>
<div class="buttons">
<button
class="btn role-secondary mr-10"
@click="close"
>
{{ t('generic.cancel') }}
</button>
<AsyncButton
:mode="'login'"
@click="login"
/>
</div>
</div> -->
</GenericPrompt>
</template>
<style lang='scss' scoped>
Expand Down
3 changes: 0 additions & 3 deletions dashboard/pkg/epinio/models/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export default class EpinioCluster extends Resource {
readyApi: string;
mgmtCluster: any

/**
*
*/
constructor(data: {
id: string,
name: string,
Expand Down
15 changes: 0 additions & 15 deletions dashboard/pkg/epinio/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ export default Vue.extend<Data, any, any, any>({
>
<div class="epinios-table">
<h2>{{ t('epinio.instances.header') }}</h2>
<!--
:row-actions="false" -->
<ResourceTable
:rows="clusters"
:schema="clustersSchema"
Expand All @@ -177,19 +175,6 @@ export default Vue.extend<Data, any, any, any>({
<template v-else />
</div>
</template>
<!-- <template #cell:name="{row}">
<div class="epinio-row">
<n-link
v-if="row.state === 'available'"
:to="{name: 'epinio-c-cluster-dashboard', params: {cluster: row.id}}"
>
{{ row.name }}
</n-link>
<template v-else>
{{ row.name }}
</template>
</div>
</template> -->
<template #cell:api="{row}">
<div class="epinio-row">
<Link
Expand Down
2 changes: 1 addition & 1 deletion dashboard/pkg/epinio/store/epinio-store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
};

if (opt.url === '/api/v1/info') {
// TODO: RC HACK FOR NOW. Reference new epinio issue
// TODO: RC Hack for now, see https://github.com/epinio/epinio/issues/2515
opt.headers.Authorization = `Basic ${ base64Encode(`admin:password`) }`;
}

Expand Down
2 changes: 0 additions & 2 deletions dashboard/pkg/epinio/store/epinio-store/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,4 @@ export default {
info: (state: any) => () => state.info,

version: (state: any) => () => state.version,

// oidcClient: (state: any) => () => state.oidcClient,
};
5 changes: 0 additions & 5 deletions dashboard/pkg/epinio/store/epinio-store/mutations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { UserManager } from 'oidc-client-ts';
import { EpinioInfo, EpinioVersion } from '../../types';

export default {
Expand All @@ -14,8 +13,4 @@ export default {
version(state: any, version: EpinioVersion) {
state.version = version;
},

// setOidcClient(state: any, oidcClient: UserManager) {
// state.oidcClient = oidcClient;
// }
};
4 changes: 0 additions & 4 deletions dashboard/pkg/epinio/utils/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ export interface EpinioAuthConfig {
localConfig?: EpinioAuthLocalConfig
}

/**
*
*/
class EpinioAuth {
private dexUserManager?: UserManager;
private localUserManager?: {
epinioUrl: string,
config: EpinioAuthLocalConfig
};
// private config?: EpinioAuthConfig;

private isLocal() {
return this.localUserManager?.config.username && this.localUserManager?.config.password;
Expand Down

0 comments on commit 7cf16ed

Please sign in to comment.