Feature #14479_ssh_keys
Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki@contractors.roche.com>
import { Resource } from '~/models/resource';
import { Resource } from '~/models/resource';
-export interface SshKey {
- name: string;
- keyType: KeyType;
- authorizedUserUuid: string;
- publicKey: string;
- expiresAt: string;
-}
-
export interface SshKeyCreateFormDialogData {
publicKey: string;
name: string;
export interface SshKeyCreateFormDialogData {
publicKey: string;
name: string;
import { AxiosInstance } from "axios";
import { snackbarActions } from '~/store/snackbar/snackbar-actions';
import { dialogActions } from '~/store/dialog/dialog-actions';
import { AxiosInstance } from "axios";
import { snackbarActions } from '~/store/snackbar/snackbar-actions';
import { dialogActions } from '~/store/dialog/dialog-actions';
-import { SshKeyCreateFormDialogData, SshKey, KeyType } from '~/models/ssh-key';
+import { SshKeyCreateFormDialogData, KeyType, SshKeyResource } from '~/models/ssh-key';
import { setBreadcrumbs } from '../breadcrumbs/breadcrumbs-actions';
export const authActions = unionize({
import { setBreadcrumbs } from '../breadcrumbs/breadcrumbs-actions';
export const authActions = unionize({
INIT: ofType<{ user: User, token: string }>(),
USER_DETAILS_REQUEST: {},
USER_DETAILS_SUCCESS: ofType<User>(),
INIT: ofType<{ user: User, token: string }>(),
USER_DETAILS_REQUEST: {},
USER_DETAILS_SUCCESS: ofType<User>(),
- SET_SSH_KEYS: ofType<SshKey[]>(),
- ADD_SSH_KEY: ofType<SshKey>()
+ SET_SSH_KEYS: ofType<SshKeyResource[]>(),
+ ADD_SSH_KEY: ofType<SshKeyResource>()
});
export const SSH_KEY_CREATE_FORM_NAME = 'sshKeyCreateFormName';
});
export const SSH_KEY_CREATE_FORM_NAME = 'sshKeyCreateFormName';
import { authActions, AuthAction } from "./auth-action";
import { User } from "~/models/user";
import { ServiceRepository } from "~/services/services";
import { authActions, AuthAction } from "./auth-action";
import { User } from "~/models/user";
import { ServiceRepository } from "~/services/services";
-import { SshKey } from '~/models/ssh-key';
+import { SshKeyResource } from '~/models/ssh-key';
export interface AuthState {
user?: User;
apiToken?: string;
export interface AuthState {
user?: User;
apiToken?: string;
+ sshKeys?: SshKeyResource[];
}
const initialState: AuthState = {
}
const initialState: AuthState = {
USER_DETAILS_SUCCESS: (user: User) => {
return {...state, user};
},
USER_DETAILS_SUCCESS: (user: User) => {
return {...state, user};
},
- SET_SSH_KEYS: (sshKeys: SshKey[]) => {
+ SET_SSH_KEYS: (sshKeys: SshKeyResource[]) => {
return {...state, sshKeys};
},
return {...state, sshKeys};
},
- ADD_SSH_KEY: (sshKey: SshKey) => {
+ ADD_SSH_KEY: (sshKey: SshKeyResource) => {
return { ...state, sshKeys: state.sshKeys!.concat(sshKey) };
},
default: () => state
return { ...state, sshKeys: state.sshKeys!.concat(sshKey) };
},
default: () => state
import * as React from 'react';
import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Button, Typography } from '@material-ui/core';
import { ArvadosTheme } from '~/common/custom-theme';
import * as React from 'react';
import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Button, Typography } from '@material-ui/core';
import { ArvadosTheme } from '~/common/custom-theme';
-import { SshKey } from '~/models/ssh-key';
+import { SshKeyResource } from '~/models/ssh-key';
type CssRules = 'root' | 'link';
type CssRules = 'root' | 'link';
}
export interface SshKeyPanelRootDataProps {
}
export interface SshKeyPanelRootDataProps {
+ sshKeys?: SshKeyResource[];
}
type SshKeyPanelRootProps = SshKeyPanelRootDataProps & SshKeyPanelRootActionProps & WithStyles<CssRules>;
}
type SshKeyPanelRootProps = SshKeyPanelRootDataProps & SshKeyPanelRootActionProps & WithStyles<CssRules>;