> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nami.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# 인증

> 최첨단 글로벌 합의 프로토콜 및 분산 저장소를 통한 클라우드 서비스 혁신

## 인증

Nami Cloud Storage는 요청 인증을 위해 AWS Signature Version 4를 사용하여 표준 S3 클라이언트 및 SDK와 호환됩니다.

### 자격 증명

요청을 인증하기 위해 두 가지 자격 증명이 필요합니다:

* 액세스 키 ID
* 비밀 액세스 키

이 자격 증명은 Nami Cloud 대시보드에서 얻을 수 있습니다.

### 인증 헤더

각 요청에는 다음 형식의 Authorization 헤더가 포함되어야 합니다:

```bash theme={null}
Authorization: AWS4-HMAC-SHA256 
    Credential=${AccessKeyID}/${date}/${region}/s3/aws4_request,
    SignedHeaders=${headers},
    Signature=${signature}
```

### 예시

```bash theme={null}
Authorization: AWS4-HMAC-SHA256 
    Credential=AKIAIOSFODNN7EXAMPLE/20231028/us-east-1/s3/aws4_request,
    SignedHeaders=host;x-amz-content-sha256;x-amz-date,
    Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc963176630326f1024
```

### SDK와 함께 사용하기

대부분의 S3 SDK는 인증을 자동으로 처리합니다. 다음은 다양한 언어의 예시입니다:

<CodeGroup>
  ```python Python theme={null}
  import boto3

  s3_client = boto3.client('s3',
      endpoint_url='https://storage.nami.cloud',
      aws_access_key_id='YOUR_ACCESS_KEY',
      aws_secret_access_key='YOUR_SECRET_KEY'
  )
  ```

  ```javascript Node.js theme={null}
  import { S3Client } from "@aws-sdk/client-s3";

  const client = new S3Client({
    endpoint: "https://storage.nami.cloud",
    credentials: {
      accessKeyId: "YOUR_ACCESS_KEY",
      secretAccessKey: "YOUR_SECRET_KEY",
    },
  });
  ```

  ```go Golang theme={null}
  import (
      "github.com/aws/aws-sdk-go/aws"
      "github.com/aws/aws-sdk-go/aws/credentials"
      "github.com/aws/aws-sdk-go/aws/session"
      "github.com/aws/aws-sdk-go/service/s3"
  )

  sess := session.Must(session.NewSession(&aws.Config{
      Endpoint:    aws.String("https://storage.nami.cloud"),
      Region:      aws.String("us-east-1"),
      Credentials: credentials.NewStaticCredentials("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", ""),
  }))

  s3Client := s3.New(sess)
  ```

  ```rust Rust theme={null}
  use aws_sdk_s3::{Client, Config};
  use aws_config::credentials::StaticCredentialsProvider;
  use aws_types::region::Region;

  let credentials = StaticCredentialsProvider::new(
      "YOUR_ACCESS_KEY".to_string(),
      "YOUR_SECRET_KEY".to_string(),
      None,
  );

  let config = Config::builder()
      .endpoint_url("https://storage.nami.cloud")
      .region(Region::new("us-east-1"))
      .credentials_provider(credentials)
      .build();

  let client = Client::from_conf(config);
  ```
</CodeGroup>

### 보안 모범 사례

1. **자격 증명 보호**
   * 자격 증명을 소스 제어에 커밋하지 마십시오
   * 자격 증명을 정기적으로 교체하십시오
   * 환경 변수 또는 안전한 자격 증명 저장소를 사용하십시오

2. **액세스 제어**
   * 최소 권한 원칙을 따르십시오
   * 가능할 경우 버킷 정책 및 IAM 역할을 사용하십시오
   * 액세스 패턴을 정기적으로 감사하십시오

3. **HTTPS**
   * API 요청에 항상 HTTPS를 사용하십시오
   * SSL/TLS 인증서를 확인하십시오
   * 클라이언트 라이브러리를 최신 상태로 유지하십시오
