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
1
110
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
190
introduction_scriptor_gem.pdf
hatsu38
1
120
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
24
17k
Just a Rails Patch Update
hatsu38
2
730
Dive into MaintenanceTasks
hatsu38
1
150
GitHub Actions is Fun
hatsu38
1
170
Other Decks in Programming
See All in Programming
iOSアプリ開発で 関数型プログラミングを実現する The Composable Architectureの紹介
yimajo
2
210
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
770
統一感のある Go コードを生成 AI の力で手にいれる
otakakot
0
3k
SODA - FACT BOOK
sodainc
1
1.1k
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
130
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
170
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
250
AIエージェントはこう育てる - GitHub Copilot Agentとチームの共進化サイクル
koboriakira
0
210
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
320
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
250
A2A プロトコルを試してみる
azukiazusa1
2
900
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
120
Featured
See All Featured
Designing for Performance
lara
609
69k
Designing Experiences People Love
moore
142
24k
Practical Orchestrator
shlominoach
188
11k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
The Pragmatic Product Professional
lauravandoore
35
6.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Unsuck your backbone
ammeep
671
58k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Typedesign – Prime Four
hannesfritz
42
2.7k
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खʹೖΔͷͰҙ֎ͱΞϦͳબࢶ