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
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
ホームラボ紹介
y_sera15
0
200
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
220
ラジオの科学
frievea
0
330
Service Connect 上のサービスに ECS Service の外側から到達できなかった話
ota1022
1
260
Head First モブプログラミング / Head First Mobprogramming
takaking22
10
12k
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
1
280
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.2k
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
140
社内の7割が使うデータ基盤を、 データチーム2人で回すためにやったこと
koh_yoshi
4
1.4k
AIのためのEthernet技術動向 (SerDes)
markunet
1
190
AI-DLC実践録_フルサイクル開発への挑戦
miyuc
0
220
ハーレムエンジニアリング
kazuma777777
0
180
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
420
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Navigating Weather and Climate Data
rabernat
0
480
The Cost Of JavaScript in 2023
addyosmani
55
10k
Exploring anti-patterns in Rails
aemeredith
3
460
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.3k
Visualization
eitanlees
152
17k
Design in an AI World
tapps
1
280
The SEO Collaboration Effect
kristinabergwall1
1
520
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
610
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
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 ࣾϓϩμΫτͰͷར༻
͋Γ͕ͱ͏͍͟͝·ͨ͠