Skip to content

Commit cc69c68

Browse files
authored
Merge pull request #3 from 0-ROK/integration-landing-demo-page
feat: 랜딩 페이지에서 RSA 키 사용 가능하도록 수정
2 parents 3284406 + 84743e5 commit cc69c68

File tree

12 files changed

+935
-566
lines changed

12 files changed

+935
-566
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ _최신 릴리즈는 [GitHub Releases](https://github.com/0-ROK/RiSA/releases/la
9999

100100
- **[RiSA Web](https://ri-sa-kklc.vercel.app/)**: 실제 앱과 동일한 사용자 흐름을 체험하며 주요 탭과 기능을 탐색할 수 있습니다.
101101
- 웹에서 작업하다가 로컬 설치가 필요하면 화면 하단의 다운로드 팝업에서 데스크톱 설치 파일을 받을 수 있습니다.
102+
- 브라우저에서도 RSA 키 생성과 암·복호화를 체험할 수 있으며, 생성된 키는 로컬 스토리지에 안전하게 보관됩니다.
103+
- 브라우저 로컬 스토리지에 저장된 데이터는 30일이 지나면 자동으로 삭제되어 장기 보관을 방지합니다.
102104
- 팝업은 GitHub Releases의 최신 버전을 조회해 운영체제에 맞는 설치 파일 링크를 직접 제공합니다.
103105
- macOS 사용자는 애플 실리콘과 인텔 아키텍처를 자동으로 감지해 올바른 설치 파일을 안내받습니다.
104106
- 팝업은 닫아도 현재 방문 중에만 숨겨지며, 페이지를 다시 열면 자동으로 나타납니다.

src/renderer/components/WebDownloadPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const WebDownloadPrompt: React.FC = () => {
338338
로컬 앱을 설치하면 모든 RSA 암·복호화 기능을 사용할 수 있어요.
339339
</Text>
340340
<Text type="secondary" style={{ fontSize: 13 }}>
341-
웹 데모에서는 키 생성과 암·복호화가 제한되므로, 데스크톱 앱을 다운로드해 보세요.
341+
브라우저에서도 키 생성과 암·복호화를 체험할 수 있지만, 민감한 데이터는 데스크톱 앱에서 처리하는 것이 더 안전합니다. 로컬에 저장된 데이터는 30일 후 자동으로 정리됩니다.
342342
</Text>
343343
<Text type={error ? 'danger' : 'secondary'} style={{ fontSize: 12 }}>
344344
{statusMessage(loading, error, asset)}

src/renderer/pages/KeyManagerPage.tsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,6 @@ const KeyManagerPage: React.FC = () => {
5858
const [selectedEditAlgorithm, setSelectedEditAlgorithm] = useState<'RSA-OAEP' | 'RSA-PKCS1'>('RSA-OAEP');
5959

6060
const handleGenerateKey = async (values: { name: string; keySize: number; preferredAlgorithm: 'RSA-OAEP' | 'RSA-PKCS1' }) => {
61-
if (isWebEnvironment) {
62-
notification.info({
63-
message: '웹 데모 제한',
64-
description: '웹 데모에서는 RSA 키 생성을 지원하지 않습니다. 데스크톱 버전에서 키를 생성하거나 직접 등록 기능을 사용해주세요.',
65-
placement: 'topRight',
66-
});
67-
return;
68-
}
69-
7061
setGenerateLoading(true);
7162
try {
7263
const keyPair = await services.crypto.generateKeyPair(values.keySize);
@@ -86,8 +77,9 @@ const KeyManagerPage: React.FC = () => {
8677
form.resetFields();
8778
message.success(`"${values.name}" 키가 생성되었습니다.`);
8879
} catch (error) {
89-
message.error('키 생성 중 오류가 발생했습니다.');
90-
console.error(error);
80+
const messageText = error instanceof Error ? error.message : '키 생성 중 오류가 발생했습니다.';
81+
message.error(messageText);
82+
console.error('Key generation failed:', error);
9183
} finally {
9284
setGenerateLoading(false);
9385
}
@@ -399,18 +391,17 @@ const KeyManagerPage: React.FC = () => {
399391
display: 'flex',
400392
flexDirection: 'column'
401393
}}>
402-
<PageHeader
394+
<PageHeader
403395
title="키 관리"
404396
icon={<KeyOutlined />}
405397
extra={
406398
<Space>
407-
<Tooltip title={isWebEnvironment ? '웹 데모에서는 키 생성을 지원하지 않습니다.' : undefined}>
399+
<Tooltip title={isWebEnvironment ? '브라우저에서도 키를 생성하고 저장할 수 있습니다. 민감한 데이터는 데스크톱 앱에서 처리하는 것을 권장합니다.' : undefined}>
408400
<Button
409401
type="primary"
410402
icon={<PlusOutlined />}
411403
onClick={() => setGenerateModalVisible(true)}
412404
size="large"
413-
disabled={isWebEnvironment}
414405
>
415406
새 키 생성
416407
</Button>
@@ -438,8 +429,8 @@ const KeyManagerPage: React.FC = () => {
438429
<Alert
439430
type="info"
440431
showIcon
441-
message="웹 데모에서는 키 생성이 제한됩니다"
442-
description="데스크톱 버전에서 생성한 키를 가져오거나 직접 키를 등록하여 기능을 체험할 수 있습니다."
432+
message="브라우저에서도 RSA 키를 생성해볼 수 있습니다"
433+
description="생성된 키는 이 브라우저의 로컬 스토리지에 저장되며 30일이 지나면 자동으로 삭제됩니다. 민감한 데이터를 다룰 때에는 데스크톱 앱 사용을 권장합니다."
443434
style={{ marginBottom: 16 }}
444435
/>
445436
)}

src/renderer/pages/MainPage.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ const MainPage: React.FC = () => {
5959
const [decryptionStatus, setDecryptionStatus] = useState<'idle' | 'success' | 'error'>('idle');
6060
const [lastError, setLastError] = useState<string>('');
6161

62-
const showWebRestrictionNotice = () => {
63-
notification.info({
64-
message: '웹 데모 제한',
65-
description: '웹 데모에서는 RSA 암·복호화 기능을 사용할 수 없습니다. 데스크톱 버전에서 전체 기능을 이용해주세요.',
66-
placement: 'topRight',
67-
});
68-
};
69-
7062
// 선택된 키가 변경될 때마다 selectedKey 업데이트 및 알고리즘 자동 설정
7163
useEffect(() => {
7264
const key = keys.find(k => k.id === selectedKeyId);
@@ -79,11 +71,6 @@ const MainPage: React.FC = () => {
7971
}, [selectedKeyId, keys, selectKey]);
8072

8173
const handleEncrypt = async () => {
82-
if (isWebEnvironment) {
83-
showWebRestrictionNotice();
84-
return;
85-
}
86-
8774
if (!encryptText.trim()) {
8875
message.error('암호화할 텍스트를 입력해주세요.');
8976
return;
@@ -157,11 +144,6 @@ const MainPage: React.FC = () => {
157144
};
158145

159146
const handleDecrypt = async () => {
160-
if (isWebEnvironment) {
161-
showWebRestrictionNotice();
162-
return;
163-
}
164-
165147
if (!decryptText.trim()) {
166148
message.error('복호화할 텍스트를 입력해주세요.');
167149
return;
@@ -512,7 +494,7 @@ const MainPage: React.FC = () => {
512494
const renderTabBarExtraContent = () => {
513495
const isEncryptTab = activeTab === 'encrypt';
514496
const hasInputText = (isEncryptTab ? encryptText : decryptText).trim();
515-
const canExecute = !isWebEnvironment && !!selectedKey && !!hasInputText && !loading;
497+
const canExecute = !!selectedKey && !!hasInputText && !loading;
516498

517499
return (
518500
<Space>
@@ -560,8 +542,8 @@ const MainPage: React.FC = () => {
560542
<Alert
561543
type="info"
562544
showIcon
563-
message="웹 데모 제한 안내"
564-
description="웹 데모에서는 RSA 암·복호화 기능이 비활성화되어 있습니다. 데스크톱 앱에서 전체 기능을 사용하거나 체인 빌더, HTTP 도구 등을 체험해보세요."
545+
message="브라우저 환경에서는 로컬에서만 데이터를 처리합니다"
546+
description="암·복호화는 이 브라우저에서만 실행되고 키는 로컬 스토리지에 보관되며 30일이 지나면 자동으로 삭제됩니다. 민감한 데이터는 데스크톱 앱에서 처리하는 것을 권장합니다."
565547
style={{ marginBottom: 16 }}
566548
/>
567549
)}

0 commit comments

Comments
 (0)