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
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
Search
hatsu
June 05, 2025
Programming
0
54
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
hatsu
June 05, 2025
Tweet
Share
More Decks by hatsu
See All by hatsu
MySQL初心者が311個のカラムにNot NULL制約を追加していってALTER TABLEについて学んだ話
hatsu38
2
170
introduction_scriptor_gem.pdf
hatsu38
1
120
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
24
16k
Just a Rails Patch Update
hatsu38
2
710
Dive into MaintenanceTasks
hatsu38
1
140
GitHub Actions is Fun
hatsu38
1
160
Other Decks in Programming
See All in Programming
try-catchを使わないエラーハンドリング!? PHPでResult型の考え方を取り入れてみよう
kajitack
3
280
Building an Application with TDD, DDD and Hexagonal Architecture - Isn't it a bit too much?
mufrid
0
370
複雑なフォームを継続的に開発していくための技術選定・設計・実装 #tskaigi / #tskaigi2025
izumin5210
12
6.3k
漸進。
ssssota
0
1.1k
Practical Domain-Driven Design - Workshop at NDC 2025
mufrid
0
130
ワンバイナリWebサービスのススメ
mackee
10
7.4k
MLOps Japan 勉強会 #52 - 特徴量を言語を越えて一貫して管理する, 『特徴量ドリブン』な MLOps の実現への試み
taniiicom
2
570
OpenNext + Hono on Cloudflare でイマドキWeb開発スタックを実現する
rokuosan
0
110
Interface vs Types ~型推論が過多推論~
hirokiomote
1
230
OpenTelemetry + LLM = OpenLLMetry!?
yunosukey
2
400
Language Server と喋ろう – TSKaigi 2025
pizzacat83
2
660
TSConfigからTypeScriptの世界を覗く
planck16
2
1.3k
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
840
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Faster Mobile Websites
deanohume
307
31k
Documentation Writing (for coders)
carmenintech
71
4.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Thoughts on Productivity
jonyablonski
69
4.7k
BBQ
matthewcrist
88
9.7k
Done Done
chrislema
184
16k
Transcript
Prism.parseͰ 300ຊҎ্͋ΔΤϯυϙΠϯτʹ ଓͰ͖ΔݖݶͷҰཡදΛ࡞ͬͯΈͨ Omotesandorb #110 @hatsu_38 2025/06/05
ࣗݾհ • Rubyྺ 6 = ΤϯδχΞྺ • SHE Inc. •
React.js / TypeScript / GitHub Actions • Ruby͕Ұ൪͖
ٕज़ελοΫ • Backend: Ruby, Ruby on Rails, GraphQL, Sidekiq •
Frontend: React.js, TypeScript, Next.js • Database: MySQL 8.0 • CI: GitHub Actions • Infrastructure: Kubernetes
ཧը໘ͷ શͯͷΤϯυϙΠϯτʹ͍ͭͯ ͲͷݖݶͰୟ͚Δ͔ ग़ͯ͠΄͍͠
Γ͍ͨ͜ͱ - PermissionͱAPIͷҰཡΛ࡞Δ • ਖ਼نදݱͰΰχϣΰχϣͯ͠Ͱ͖ͦ͏͕ͩɺ"45ͰͬͯΈͨ
Γ͍ͨ͜ͱ - PermissionͱAPIͷҰཡΛ࡞Δ • ͜Μͳײ͡ͷ.BSLEPXOΛੜ͢Δ
Γ͍ͨ͜ͱ - PermissionͱAPIͷҰཡΛ࡞Δ • ͜Μͳײ͡ͷ.BSLEPXOΛੜ͢Δ 1. શ"1*ͷΫϥε໊Λऔಘ͢Δ 2. શ"1*ͷ1VCMJDͳΞΫγϣϯ໊Λऔಘ͢Δ 3.
શ"1*ͷCFGPSF@BDUJPOΛऔಘ͢Δ 4. શ෦Λ߹ମͤͯ͞ZNMΛ࡞Δ 5. yml͔ΒMarkdownΛ࡞Δ ͜͜ΛASTͰ࣮ݱ͢Δ
Prism.parseʹ͍ͭͯ - AST(நߏจ)ΛΈཱͯΔ
None
CallNodeΛൈਮ
IntegerNodeΛൈਮ
Node͍ͬͺ͍͋Δ https://docs.ruby-lang.org/en/3.4/table_of_contents.html#classes
Prism.parseͷ݁ՌΛ͍͡ΕControllerͷ Class໊ͷऔಘͰ͖Δ
NodeΛ؆୯ʹऔಘ͍ͨ͠ - Prism::Visitor visit_୳ࡧ͍ͨ͠Node໊_node
NodeΛ؆୯ʹऔಘ͍ͨ͠ - Prism::Visitor visit_୳ࡧ͍ͨ͠Node໊_node
Class໊Λ؆୯ʹऔಘ͍ͨ͠ - Controllerͷྫ visit_୳ࡧ͍ͨ͠Node໊_node
Class໊Λ؆୯ʹऔಘ͍ͨ͠ - ClassNodeऔಘ visit_୳ࡧ͍ͨ͠Node໊_node ClassNode ίϯτʔϥʔ໊औಘʂ
Class໊Λ؆୯ʹऔಘ͍ͨ͠ - Prism::Visitor visit_୳ࡧ͍ͨ͠Node໊_node
ࠓճͬͨ visit_**_node • visit_class_node -> Controllerͷ໊લऔಘ • visit_call_node -> before_actionͷऔಘprivateϝιου͔Ͳ͏͔ͷఆ
• visit_module_node -> ωετ͞Εͨ$POUSPMMFSͷ.PEVMF໊औಘ • visit_def_node -> Controllerʹఆٛ͞ΕͨAction໊औಘ • visit_keyword_hash_node -> before_actionͷonlyͷऔಘ
͓ΘΓʹ 1.ਖ਼نදݱͰ࣮ݱͰ͖͚ͨͲASTͰ৮ͬͯΈ·ͨ͠ 2.Prism.parseͨ͠ΒNodeखʹೖΔ͠ 3.Prism::VisitorΛ͑ཉ͍͠NodeखʹೖΔͷͰҙ֎ͱΞϦͳબࢶ