Security Study/Base Of Computer

Github API ์‚ฌ์šฉ์„ ์œ„ํ•œ ํ† ํฐ ๋ฐœ๊ธ‰

๐“›๐“พ๐“ฌ๐“ฎ๐“ฝ๐“ฎ_๐“ข๐“ฝ๐“ฎ๐“ต๐“ต๐“ช 2022. 11. 14.
728x90
๋ฐ˜์‘ํ˜•

ํ•ด๋‹น ๋ธ”๋กœ๊ทธ๋Š” ํ•ดํ‚น ๋ฐ ๋ณด์•ˆ ๋ธ”๋กœ๊ทธ๋กœ ๊ณต๋ถ€ ๋ฐ ์—ฐ๊ตฌ์šฉ์œผ๋กœ ์ž‘์„ฑ๋˜์–ด์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์˜ ๋‚ด์šฉ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•ดํ‚น ์‹œ๋„ ๋ฐ ์‹ค์ œ ๊ณต๊ฒฉ์„ ์‹œ๋„ํ•˜์—ฌ ์ผ์–ด๋‚˜๋Š” ๋ชจ๋“  ์ฑ…์ž„์€ ๋ณธ์ธ(๋”ฐ๋ผํ•œ์ž)์—๊ฒŒ ์žˆ์Œ์„ ์•Œ๋ ค๋“œ๋ฆฌ๋ฉฐ, ๊ธ€์“ด์ด๋Š” ์•„๋ฌด๋Ÿฐ ์ฑ…์ž„์„ ์ง€์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ผญ ๊ณต๋ถ€ ๋ฐ ์—ฐ๊ตฌ์šฉ์œผ๋กœ๋งŒ ์‚ฌ์šฉํ•˜์—ฌ ์ฃผ์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

์ตœ๊ทผ์— ์–ด์ฉŒ๋‹ค ๋ณด๋‹ˆ github๋ฅผ ์‚ฌ์šฉํ•ด์•ผํ•˜๋Š” ์—…๋ฌด๋ฅผ ์ง„ํ–‰ํ•˜์˜€๋‹ค.

์‚ฌ์‹ค ๊ฐœ๋ฐœ์„ ๋งŽ์ด ํ•˜์ง€์•Š๋‹ค๋ณด๋‹ˆ github๋ฅผ ํฌ๊ฒŒ ์‚ฌ์šฉํ•˜์ง€์•Š์•˜๋Š”๋ฐ...

์‚ฌ์šฉํ•ด๋ณด๋ ค ํ•˜๋‹ˆ ์–ด๋ ค์›€์ด ์ด๋งŒ์ €๋งŒ์ด ์•„๋‹ˆ๋”๋ผ ...

์–ด์ฐŒ์–ด์ฐŒ ์ด๊ฒƒ์ €๊ฒƒํ•˜๋‹ค๊ฐ€ ๊ทธ๋ƒฅ API๋ฅผ ์‚ฌ์šฉํ•ด์•ผ๊ฒ ๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์–ด์„œ api๋ฅผ ์‚ฌ์šฉํ•˜๋ คํ•˜๋‹ˆ

์‚ฌ์šฉ์ž ์ธ์ฆ์— ๋Œ€ํ•œ token์ด ํ•„์š”ํ•˜์˜€๋‹ค. ๊ทธ๋ž˜์„œ token ์ƒ์„ฑ๋ถ€ํ„ฐ ์•„๊ธฐ์ž๊ธฐํ•˜๊ฒŒ ์ž‘์„ฑํ•˜๋ คํ•œ๋‹ค.

 

https://github.com/

 

GitHub: Let’s build from here

GitHub is where over 83 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

github.com

๋จผ์ € github์—์„œ ๊ณ„์ •์„ ๋งŒ๋“ค์–ด์•ผ ํ•œ๋‹ค.

๊ณ„์ •์„ ๋งŒ๋“ค๊ณ  ๋‚˜์„œ ํ”„๋กœํ•„์„ ๋ˆ„๋ฅด๊ณ  Settings๋ฅผ ๋ˆŒ๋Ÿฌ์ฃผ์ž

๊ทธ๋Ÿผ ์—ฌ๋Ÿฌ ๋ฉ”๋‰ด๋“ค์ด ๋‚˜์˜ฌํ…๋ฐ ๋งจ์•„๋ž˜๋กœ ๋‚ด๋ฆฌ๋ฉด Developer settings๊ฐ€ ๋‚˜์˜จ๋‹ค

์š”๊ฒƒ์„ ํด๋ฆญํ•˜๋„๋ก ํ•˜์ž

๊ทธ๋Ÿผ ์—ฌ๊ธฐ์„œ Personal access tokens๋ผ๋Š” ๋ฉ”๋‰ด๊ฐ€ ์žˆ๋Š”๋ฐ

๊ธฐ์กด์—๋Š” Tokens๋งŒ ์กด์žฌํ–ˆ์œผ๋‚˜ ์–ด๋Š์ˆœ๊ฐ„ Fine-grained tokens๋ผ๋Š” ๊ฒƒ๋„ ์ƒ๊ฒผ๋‹ค.

์šฐ๋ฆฌ๋Š” Tokens(classic)๋งŒ ์‚ฌ์šฉํ•  ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— Tokens(classic)ํด๋ฆญ

๊ทธ๋Ÿผ ์ด ๊ฒƒ์ด ๋ณด์ด๋Š”๋ฐ Generate new token ํด๋ฆญํ•ด์ฃผ์ž

์—ฌ๊ธฐ์„œ๋Š” ๋‹น์—ฐํ•˜๊ฒŒ Generate new token(classic)์„ ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

token์ด ๊ณ„์ • ์—ญํ• ์„ ํ•˜๊ธฐ๋•Œ๋ฌธ์— ์ธ์ฆ์„ ํ•˜๋Š” ๋“ฏํ•˜๋‹ค. ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜๊ณ 

Note๋Š” Name์ด๋ผ๊ณ  ์ƒ๊ฐํ™”๋ฉด ๋  ๊ฒƒ๊ฐ™๋‹ค.

Expiration์€ ๋งŒ๋ฃŒ์ผ์ด๋‹ค. ํ•ด๋‹น ๊ธฐ๊ฐ„์ด ์ง€๋‚˜๋ฉด ๋งŒ๋ฃŒ๊ฐ€๋˜์–ด ์‚ฌ์šฉํ•˜์ง€๋ชปํ•œ๋‹ค.

select scopes๊ฒฝ์šฐ ๊ถŒํ•œ์„ ์ฃผ๋Š” ๊ฒƒ์ธ๋ฐ ๊ธฐ๋ณธ์ ์œผ๋กœ repo๋งŒ ์ฃผ๊ณ  ์‚ฌ์šฉํ•ด๋„ ๋ฌด๋ฐฉํ•˜์ง€์•Š์„๊นŒ์‹ถ์€๋ฐ.

๊ฐœ๋ฐœํ•˜๋Š” ๊ฑฐ์— ๋”ฐ๋ผ ๊ถŒํ•œ์ด ๋‹ฌ๋ผ์ง€๊ธฐ๋•Œ๋ฌธ์— ์ž˜ ์ƒ๊ฐํ•ด์•ผํ•  ๊ฒƒ๊ฐ™๋‹ค.

 

๋„ˆ๋ฌด ๋งŽ์€ ๊ถŒํ•œ์„ ์ฃผ๋ฉด ํ„ธ๋ฆฌ๊ฒŒ๋˜๋ฉด ๋‹ต์—†์œผ๋‹ˆ ์ฃผ์˜ํ•˜๋„๋กํ•˜์ž.

 

์ด๋ ‡๊ฒŒํ•˜๋ฉด token๋ฐœ๊ธ‰์ด ๋๋‚ฌ๋‹ค.

 

token๋ฐœ๊ธ‰์„ ํ•จ์œผ๋กœ์จ github api, rest api ๋“ฑ์„ ์‚ฌ์šฉํ•จ์— ์กฐ๊ธˆ ๋” ํŽธ๋ฆฌํ•˜๊ฒŒ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค.

์ถ”ํ›„์—๋„ github์— ๊ด€๋ จ ์ž‘์„ฑํ•˜๋Š” ๋‚ ์ด ์˜ค๋ฉด ์ž‘์„ฑํ† ๋กํ•˜๊ฒ ๋‹ค.

 

728x90
๋ฐ˜์‘ํ˜•

'Security Study > Base Of Computer' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

๊ณ ์ • ์†Œ์ˆ˜์   (2) 2018.09.26

๋Œ“๊ธ€0

๊ด‘๊ณ  ํ•œ๋ฒˆ ๋ณด๊ณ  ๊ฐ€์‹ค๊ฒŒ์š”!