Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Basic認証の視覚化 / visualize basic authentication
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ozw
May 13, 2019
Technology
1.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Basic認証の視覚化 / visualize basic authentication
ozw
May 13, 2019
Other Decks in Technology
See All in Technology
ルールやカスタム機能、どう活かす?ハンズオンで体感するIBM Bobの出力コントロール
muehara
1
170
AIっぽい文章を採点して人間らしく直すアプリを作ってみた
yama3133
2
190
【NRUG vol.18】KubernetesにおけるNew Relicデータ取得量削減の考え方
nrug_member
0
120
200個のGitHubリポジトリを横断調査したかった
icck
0
130
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
390
脆弱性対応、どこで線を引くか
rymiyamoto
1
390
マルチアカウント環境での コーディングエージェントを使った障害調査が大変なので AIエージェントにReadOnly権限を付与してみた / ReadOnly AI Agents for Multi-Account AWS Incident Response
yamaguchitk333
2
110
非エンジニアがClaudeと挑んだ「1ヶ月間プロダクト30本ノック」
askokc
0
540
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
150
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
1.1k
AIソロプレナー時代に2ヶ月で20人増員した事業創造会社の開発組織の話
miyatakoji
0
670
Snowflakeと仲良くなる第一歩
coco_se
4
470
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
590
Google's AI Overviews - The New Search
badams
0
1k
Chasing Engaging Ingredients in Design
codingconduct
0
220
Leo the Paperboy
mayatellez
7
1.8k
How GitHub (no longer) Works
holman
316
150k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Faster Mobile Websites
deanohume
310
31k
HDC tutorial
michielstock
2
710
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
400
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
410
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
620
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Transcript
#BTJDೝূͷՄࢹԽ P[X
લఏ ৽نϓϩδΣΫτ࡞࣌ #"4*$ೝূͰެ։อޢ ։ൃ࣌ *%18ͷೖྗ͕໘ͳͷͰϒϥβʹอଘ
લఏ ϦϦʔεલ #BTJDೝূΛղআɺ͍ͨͩͬͯΔҙ͕ࣝ ബΕ͍ͯΔͷͰղআΛΕͯ͠·͏͜ͱ ͕͋Δ
લఏ ϦϦʔεલ #BTJDೝূΛղআɺ͍ͨͩͬͯΔҙ͕ࣝ ബΕ͍ͯΔͷͰղআΛΕͯ͠·͏͜ͱ ͕͋Δ #"4*$ೝূΛ͍ͬͯΔ͜ͱΛ Εͳ͍Α͏ʹ͍ͨ͠
CBTJD@BVUI@NBSLHFN
CBTJD@BVUI@NBSLHFN w#"4*$ೝূ͕ઃఆ͞Ε͍ͯΔͱ(JUIVC SJCCPOΛදࣔͯ͘͠ΕΔ(FN w3BJMTFOWΛSJCCPOͰදࣔͯ͘͠ΕΔSBDL EFWNBSLHFNΛࢀߟʹ࡞
͍ํ # Gemfile gem 'basic_auth_mark' $ bundle install
͍ͬͯΔ͜ͱ w3BJMTBQQىಈ࣌ʹ3BDL.JEEMFXBSFʹ CBTJD@BVUI@NBSLΛՃ wSFRVFTU࣌ʹ#"4*$ೝূͷϔομ͕ೖͬͯ ͍ͨΒSJCCPOΛදࣔ
3BDLNJEEMFXBSF class Middleware1 def initialize(app) # app == Middleware2 @app
= app end def call(env) # Middleware2ͷcall͕ݺΕΔ. res = @app.call(env) # ඞཁʹԠͯ͡ॲཧΛߦ͏. res end end
ྫɿTFOUSZͰͷΘΕํ # sentry-raven def call(env) # ... begin response =
@app.call(env) rescue Error raise # Don't capture Raven errors rescue Exception => e Raven::Rack.capture_exception(e, env) raise end # ... response end
CBTJD@BVUI@NBSLͰͷ͍ํ def call(env) status, headers, response = @app.call(env) if basic_auth?
# </head> to <link rel="stylesheet" ...></head> # <body> to <body><div class="github-fork-ribbon" ...> new_response = insert_basic_auth_marks(response) # update body size. headers['Content-Length'] = new_response.bytesize.to_s response = [new_response] end [status, headers, response] end
#"4*$ೝূͷఆ SFRVFTUIFBEFS "VUIPSJ[BUJPO#BTJD\#BTFFODPEF JEQX ^ ͜ͷϔομ͕ϦΫΤετʹؚ·Ε͍ͯΔ߹ #"4*$ೝূ͋Γͱఆ
w αʔόʔଆͰ#"4*$ೝূΛͬͯΫϥΠΞϯτ ϒϥ β "VUIPSJ[BUJPOϔομΛૹΓଓ͚Δ w ࣮ࡍʹ#"4*$ೝূΛ͔ͨ͠Ͳ͏͔SBDLNJEEMFXBSFʹ Δใ͔ΒΘ͔Βͳ͍ ೝূʹޭͨ͠߹ͱೝূ͠
ͳ͔ͬͨ߹Ͱม͕ಉ͡ w ͳͷͰɺݱঢ়"VUIPSJ[BUJPO#BTJDϔομͷ༗ແͷΈͰ ఆ͍ͯ͠Δ αʔόʔͰೝূͬͨ͋ͱSJCCPO͕දࣔ ͞Εͯ͠·͏
ͱΓ͋͑ͣͷ ରԠࡦɹ $ISPNF DISPNFSFTUBSU DIPSNFϦελʔτͰ#"4*$ೝূͷΩϟογϡ͕ΫϦ Ξ͞ΕΔΑ͏ όʔδϣϯʹΑΔʁ 4BGBSJ
#"4*$ೝূΩϟογϡͷํ๏͕ݟ͚ͭΒΕͣɻɻ
͜Ε͔ΒΓ͍ͨ͜ͱ w ࠶ىಈΩϟγϡͷΫϦΞΛ͠ͳͯ͘#"4*$ೝূΛ ఆͰ͖ΔΑ͏ʹରԠ w ࣾϓϩμΫτͰͷར༻
͋Γ͕ͱ͏͍͟͝·ͨ͠