Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

여러개의 private key를 리턴하는 API #6

Open
KimKiHyuk opened this issue Oct 28, 2020 · 3 comments
Open

여러개의 private key를 리턴하는 API #6

KimKiHyuk opened this issue Oct 28, 2020 · 3 comments
Assignees

Comments

@KimKiHyuk
Copy link
Contributor

KimKiHyuk commented Oct 28, 2020

구현 내용

GET /v1/terraform/user001?workspace=key

쿼리로 들어오는 workspace는 테라폼에서 처리를 위한 파라메터이니 신경 쓰지 않으셔도 됩니다 :)

입력

"outputs": {
    "result": {
      "value": [
        "ec2_team-0": "1234",
        "ec2_team-1": "12345",
        "ec2_team-2": "123456"
      ],
      "type": [
        "list",
        "string"
      ]
    }
  }, ....

출력

{
 "result" : [
    {"ec2_1" : aes256(1234)},
    {"ec2_2" : aes256(12345)},
    {"ec2_3" : aes256(123456)}
  ]
}

동작방식

// GET 요청 발생
// 테라폼에서 user001과 workspace=key 값을 참고하여 workspace 변경
// var file = /어딘가에 위치한 파일/terraform.tfstate

// 위에 까진 제가 개발해야하는 내역입니다, file 위치는 전달드린 파일로 해서 개발해주세요!
// file 을 읽어서 result 생성 및 200 과 함께 return, 단 키값은 aes256으로 암호화할 것

@nnnlog
Copy link
Member

nnnlog commented Oct 28, 2020

궁금한게 있는데 AES 키 교환은 어떻게 하실 예정인가요?

@KimKiHyuk
Copy link
Contributor Author

궁금한게 있는데 AES 키 교환은 어떻게 하실 예정인가요?

프론트랑 상의해서 static하게 박아두려고 합니다 (네트워크 교환 X)

@KimKiHyuk
Copy link
Contributor Author

https://github.com/ECTwo/ec2-backend/commits/aws/keys

위 브랜치 베이스에서 작업해주시면 됩니다.

$ git checkout aws/keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants