ã¯ããã« Railsã¢ããªã«OAuth2èªè¨¼ãå°å ¥ããå ´åã«å©ç¨ã§ããOmniAuthãããã¾ãã TwitterãGitHubãªã©ã®å¤é¨èªè¨¼ç¨ã«ãã§ã«ããã¤ãStrategyãç¨æããã¦ãã¾ãã ãªã¹ãã«ãªãå ´åã¯èªä½ãããã¨ã«ãªãã¾ãããèªè¨¼ãµã¼ãã¹ç¨ã®Strategyãä½ææã«ã¯ã¾ã£ãç¹ãç´¹ä»ãã¾ãã ç¹ã«OmniAuthå¦çãããã¯ãããã¨ãã®åçãªãã©ã¡ã¼ã¿ãæ±ãç¹ã¯ãæ¤ç´¢ãã¦ãæ å ±ãè¦ã¤ããããªãã£ãã®ã§è¦å´ãã¾ããã åèã«ãªãã°å¹¸ãã§ãã ããã§åãä¸ãããã¤ã³ã OAuthç¨ã®URLãå¤æ´ãã callback_urlã®æ³¨æç¹ï¼ããã©ã«ãã®ã¾ã¾ã ã¨ã¨ã©ã¼ã«ãªã£ã¦ãã¾ããã¿ã¼ã³ï¼ OmniAuthå¦çãããã¯ãããã¨ãã®ãã©ã¡ã¼ã¿ãèªè¨¼æã®ãã©ã¡ã¼ã¿ã¨ãã¦æ¸¡ã OmniAuthå¦çãããã¯ãããã¨ãã®ãã©ã¡ã¼ã¿ãapiå¼ã³åºãçµæã«æ ¼ç´ãã OAuth2ã®å¦çã®æµãã¯ãã¡ã
使ç¨ããã©ã¤ãã©ãªã¯ãã¡ãã§ãã https://github.com/kazasiki/omniauth-line çµã¿è¾¼ãã ã¢ããªã§omniauth-google-oauth2ã使ç¨ãã¦ãã¦ãomniauth-google-oauth2ãomniauth-oauth2ã®ãã¼ã¸ã§ã³1.6以ä¸ãè¦æ±ãã¦ããã®ã§åé¡ãèµ·ããã¾ããã 詳ããã¨ã©ã¼ã®å 容ã¨ãæ ¹æ¬çãªåé¡ã¯ã¹ã¿ãã¯ãªã¼ãã¼ããã¼ã«æ稿ããç確ãªåçãããã ããã®ã§ãã¡ããã覧ãã ããã ãã¼ã¯ã³ããªã¯ã¨ã¹ãããæã®å¿ é ãã©ã¡ã¼ã¿redirect_uriã«å¿ è¦ã®ç¡ããã©ã¡ã¼ã¿ãä»ä¸ããã¦ãã®ã§redirect_uri does not matchã«ãªã£ã¦ããããã§ããããããããªã¯ã¨ã¹ãçµã¿ç«ã¦ã¦ãã®ä¿ºããããããã©ãããã°è¯ãã®ï¼ã¨ããã¨ããã解説ãããã¨æãã¾ãã ãã®è¾ºã§omniauth-oauth2ã¯callback_ur
ï¼ãã®è¨äºã¯ãMoney Forward Advent Calendar 2015ãã®20æ¥ç®ã®è¨äºã§ãï¼ æè¿ OmniAuth ç¨ã® OAuth2 ã®ã¹ãã©ãã¸ã¼ãä½ãæ©ä¼ãä½åº¦ããã£ãã®ã§ãgem ã®ã³ã¼ããããã¥ã¡ã³ããèªãã§èª¿ã¹ããã¨ãã¾ã¨ãã¾ãããç¬èªã« OmniAuth ã®ã¹ãã©ãã¸ã¼ãç¹ã« OAuth2 ã®ã¹ãã©ãã¸ã¼ãä½ãå ´åã¯æ¯éåèã«ãã¦ãã ããã ãªããæ¬æ稿㯠OmniAuth ã® Strategy Contribution Guide ããã³ OmniAuthãOmniAuth OAuth2ãããã« æå¿ãéçºãã OmniAuth ç¨ã®å種ã¹ãã©ãã¸ã¼ã®å®è£ ãåèã«ãã¦ãã¾ãã OmniAuth OmniAuth ã¯ãèªè¨¼ãããã¤ããå©ç¨ãã¦ã¦ã¼ã¶èªè¨¼ããæ¹æ³ãæ¨æºåããããã® gem ã§ãã ä¾ãã°ãWeb ã¢ããªã±ã¼ã·ã§ã³ãä½ãã¨ãã«ãè¤æ°ã®èªè¨¼ãããã¤ã
æ¦è¦ åèè ã®è¨±è«¾ãå¾ã¦ç¿»è¨³ã»å ¬éãããã¾ãã è±èªè¨äº: The Practical Effects of the GVL on Scaling in Ruby åæå ¬éæ¥: 2020/05/11 èè : Nate Berkopec ãµã¤ã: Speedshop -- ããã³ãã¨ã³ããããã¯ã¨ã³ããç°å¢ãå«ãããã«ã¹ã¿ãã¯ã®Railsããã©ã¼ãã³ã¹ã³ã³ãµã«ã¿ã³ãã§ãã ç»åã¯å è¨äºããã®å¼ç¨ã§ãããèä½æ¨©ã確èªããããªããã®ã¯ãªã³ã¯ã«ã¨ã©ãã¾ããã ã³ã³ã«ã¬ã³ã·ã¼ã¨ãã©ã¬ãªãºã ã®èª¬æãã¨ã¦ãä¸å¯§ãªã®ãå¬ãããã¤ã³ãã§ãðã æ¦è¦: MRI Rubyã®Global VM Lockï¼GVLï¼ã¯ãä½ãã¨èª¬æãçå¤ãã ã£ãã誤解ããããæ¹å¤ã«ããããããããã¡ã§ããRubyã¯GVLã®ããã§ã³ã³ã«ã¬ã³ã·ã¼ã«ãã¹ã±ã¼ãªã³ã°ã«ãç¸ããªãã®ã§ããããï¼ãã®ç¹ãå®å ¨ã«ç解ããã«ã¯ãRubyã®ä»®æ³ãã·ã³ï¼
æè¡éçºé¨ã§ä¸»ã«ããã¯ã¨ã³ãéçºããã¦ããæµç°(@hamchance0215)ã§ãã ç¾å¨éçºä¸ã®ãããã¯ãã®ããã¯ã¨ã³ãã¯Rails + graphql-rubyã使ã£ã¦ãã¾ãã GraphQLã使ã£ãéã®ãã¡ãªããã¨ãã¦N+1ãçºçããããã¨ãããã¨ãããè¨ããã¾ãã å¼ç¤¾ã§ãä¾å¤ã§ã¯ãªããéæã§N+1ãçºçãã¦ãã¾ããã ä»ã¾ã§ã¯ããã³ãã¨ã³ãããã®ä½¿ããæ¹ãèæ ®ãã¦ããµã¯ãã¨å®è£ ã§ããå èªã¿(preloadç)ã§N+1ãåé¿ãã¦ããã®ã§ãããã¯ã¨ãªã¼æ°ãå¢å ãããã¨ã§ã¯ã¨ãªã¼ãã¨ã«ä½¿ããæ¹ãææ¡ããã®ã¯é£ãããªã£ã¦ããã®ã¨ãåãã¯ã¨ãªã¼ã§ãã£ãã¨ãã¦ã使ããæ¹ãå¤æ§åãã¦å èªã¿ã§ã¯éå¹çã«ãªããã¨ãæ¸å¿µããã¾ãã(å èªã¿ãéå¹çã«ãªã件ã¯å¾è¿°ãã¾ã)ã ããã§éãè °ãããã¦ãé 延ãã¼ããå°å ¥ããããã«èª¿æ»ãè¡ããã¨ã«ãã¾ããã â»ãã®è¨äºã¯å·çæç¹(2021/06)ã®æ å ±ã§è¨è¼ãã
ãã®è¨äºã¯GLOBIS Advent Calendar 2020ã®19æ¥ç®ã®è¨äºã§ãã æ°è¦ãµã¼ãã¹ã®éçºã«ããã¯ã¨ã³ãã¯Ruby on Rails + GraphQLãã¯ã©ã¤ã¢ã³ããµã¤ãã¯Reactã使ã£ã¦ãã¾ããããã¯ã¨ã³ãå´ã§ã¯GraphQL Rubyãã©ã¤ãã©ãªã¨ãã¦ä½¿ç¨ãã¦ãã¾ããå®éã«GraphQL Rubyãéçºã«çãè¾¼ãã§ãã¦ãããã¨ãæ¸ãã¦ããã¾ãã ãªã GraphQL + React ãæ¡ç¨ããã®ã æã ãç¾å¨éçºä¸ã®æ°è¦ãµã¼ãã¹ã§ã¯ãµã¼ãã¼ãµã¤ãã« GraphQLãããã³ãã¨ã³ãã« React.js ãæ¡ç¨ãã¾ããã ã°ãã¼ãã¹ã§ãµã¼ãã¹å´ã¯ããã³ãã¨ã³ãã« React.js ã主ã«æ¡ç¨ãã¦ããç¥è¦ã»ãªã½ã¼ã¹å ±ã«ãµã¼ãã¹ç«ã¡ä¸ãã®éçºé度ãæ ä¿ããããã«ååã§ããããµã¼ãã¼ãµã¤ãã«ã¤ãã¦ã¯ Ruby on Rails ãå©ç¨ãã¦ãããAPIã«ã¤ãã¦ã¯ Swagger
You work on a mature web application that cleanly separates backend and frontend. The server-side code, written in Ruby, is mostly responsible for translating HTTP requests into SQL statements (with the help of an ORM) through rich and well-documented API. You choose GraphQL over REST to streamline your endpoints, but your database is not happy with all the extra queries. After much searching, you
RailsãSinatraãªã©ã®Ruby製Webãã¬ã¼ã ã¯ã¼ã¯ãå©ç¨ããã¦ããæ¹ã¯ãRackã¨ãããã¼ã¯ã¼ããä¸åº¦ã¯ç®ã«ãããã¨ãããã®ã§ã¯ãªãã§ããããã ããèããã©è©³ããã¯ç¥ããªãããããªãã¤ãRackã§ãã ä»åã¯èªåã®ç¥èã®æ´çãå ¼ãã¦ãRackã¨ã¯ä½ãã®ãªã®ãã«ã¤ãã¦èª¿ã¹ãã¡ã¢ããããã«æ®ãã¾ããé·ãã£ãã®ã§ãå ¨3åã«åå²ãã¦ãã¾ãã ç®æ¬¡ [æ¬è¨äº] Rackå ¥é æ¦å¿µç·¨(1/3) Rackå ¥é Rack Applicationç·¨ (2/3) Rackå ¥é Rack Middlewareç·¨ (3/3) Rackã¨ã¯ä½ããã²ã¨ãã¨ã§ Webã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã¼ã¨ã¢ããªã±ã¼ã·ã§ã³ãæ¥ç¶ããããã®æ¨æºåãããã¤ã³ã¿ã¼ãã§ã¼ã¹ã®ã㨠Rackã¨ã¯ä½ãã詳細 Rackã®å ¬å¼ãªãã¸ããªã§ã¯ãRackã¯ä»¥ä¸ã®ããã«è¨è¼ããã¦ãã¾ãã ããã¦ã Supported web servers
How can I change the route that triggers omniauth from using /auth/:provider to /myapp/auth/:provider ? I don't want to redirect either, because my server will send anything that's not in /myapp/ to the wrong place.
ãã® 2 種é¡ã®æ¸ãæ¹ã«ã¯ã©ã®ãããªéããããã®ãã«ã¤ãã¦èª¬æãã¾ãã ãªããæ¬ç¨¿ã§ã¯ä¾¿å®ä¸ãåè ã®ãããªæ¸ãæ¹ããã¹ãè¨æ³ãå¾è ã®ãããªæ¸ãæ¹ãã³ã³ãã¯ãè¨æ³ã¨å¼ã¶ãã¨ã«ãã¾ãã TL;DR ãã¹ãè¨æ³ã¯åé層ã®åå空éãã¨ã« class ã module ããæ確ã«æå®ããããã³ã³ãã¯ãè¨æ³ã¯æå®ããªã ãã¹ãè¨æ³ã¯æªå®ç¾©ã®å ´åã«æ°ãã«å®ç¾©ããããã³ã³ãã¯ãè¨æ³ã¯æªå®ç¾©ã®å ´åã¯ä¾å¤ãçºçãã class 㨠module ãæ確ã«åºå¥ãããã©ãã ãã¹ãè¨æ³ã§ã¯ããããã®åå空éã«å¯¾ã㦠class ã module ããæ確ã«æå®ãã¾ãã
çµè« Rubyã§ã¯ãåçã«ã¯ã©ã¹ã«çãã¦ããã¡ã½ãããæ¸ãæããããããããã¹ã¿ããªãã£ãä¸ããããã«DIã使ããªãã å人çã«ã¯ã¹ãã©ãã¸ã¼ãã¿ã¼ã³ä½¿ãããã¨ãããããããDI使ããªãããããªãããªã¼ã£ã¦æã£ã¦ããã Rubyã§ãã¹ã¿ããªãã£åä¸ã®ããã«DIã使ããªãçç± DIã使ãçç±ã¯ãçµå度ã®ä½ä¸ããã¹ã¿ããªãã£ã®åä¸ã主ãªçç±ã ã¨æãã¾ãã ä¸è¬çãªè¨èªã®å ´åã«ã¯ãå¼æ°ã«ã¤ã³ã¿ã¼ãã§ã¼ã¹ãæå®ãã¦ãã¤ã³ã¿ã¼ãã§ã¼ã¹ã«ä¾åããããã«ãããã¨ã§ãã¹ãæã«ã¢ãã¯ãªãã¸ã§ã¯ããæ³¨å ¥ã§ããããã«ããã¨æãã¾ããããããRubyã®å ´åã«ã¯ãåçã«ã¯ã©ã¹ã«çãã¦ããã¡ã½ãããæ¸ãæããããããã¹ã¿ããªãã£ãä¸ããããã«DIãããã®ã¯æå³ããªãã§ãã Rubyã§ã¯ãrspecãç¨ãã¦ä¸è¨ã®ããã«æ¸ãã ãã§ã¯ã©ã¹ã®ã¡ã½ãããæ¸ãæãããã¨ãã§ãã¾ããããã«ãããã¹ãå®è¡æã«ã¯ã¯ã©ã¹ã®ã¡ã½ããã®å 容
æ¬ç¨¿ã¯ããããã¹ãã§éãããã¤ãã³ãã RuPy ãã§ãPat Shaughnessyãæ«é²ãããã¬ã¼ã³ã®å 容ãã¾ã¨ãããã®ã§ãã ãã¬ã¼ã³ã®æ åã¯ãã ããè¦è´ã§ãã¾ãã æ¬ç¨¿ã¯å½åã åæ°ã®å人ããã° ã«æ稿ããã¾ããããåæ°ã®äºæ¿ãå¾ã¦ãCodeshipã«åæ²è¼ãã¾ãã ãã®ã¤ãã³ãã¯ãRubyã¨Pythonãã«é¢ããã«ã³ãã¡ã¬ã³ã¹ãªã®ã§ãRubyã¨Pythonã§ã¯ãã¬ãã¼ã¸ã³ã¬ã¯ã·ã§ã³ï¼ä»¥ä¸ãGCãï¼ã®åä½ãã©ãéãã®ããæ¯è¼ããã¨é¢ç½ãã ããã¨ç§ã¯æãã¾ããã ãã ããã®æ¬é¡ã«å ¥ãåã«ããããããªããGCãåãä¸ããã®ãã«ã¤ãã¦ã話ããã¾ããæ£ç´è¨ã£ã¦ããããé åçãªããããããããã¼ãã§ã¯ãªãã§ãããï¼ãçããã®ä¸ã§GCã¨èãã¦ãå¿ãã¨ããããæ¹ã¯ããã£ãããã¾ããï¼ãï¼»å®ã¯ãã®ã«ã³ãã¡ã¬ã³ã¹åºå¸è ã®ä¸ã§ãããã§æãæãã人ã¯æ°åãã¾ããï¼ï¼½ Rubyã³ãã¥ããã£ã§æè¿ãRub
ãã®è¨äºã¯ä½ã Rails 㧠GraphQL ããã£ã¦å¾ãç¥è¦ããã graphql-batch ã¨ãã gem 㨠Batching ã¨ããä»çµã¿ã«ã¤ãã¦æ¸ãã¦ã¿ã¾ãã è¨äºä¸ã«åºã¦ããã³ã¼ã㯠https://github.com/tanaka51/sample-rails-graphql-batch ãã¡ãã®ãªãã¸ããªã«ã³ããããã¦ããã®ã§ãå®éã«åããã¦ã¿ããæ¹ã¯åèã«ãã¦ã¿ã¦ãã ããã æ¸ãã¦ããªãã㨠GraphQL ã«ã¤ã㦠N+1 ã«ã¤ã㦠ã¢ããã³ãã«ã¬ã³ãã¼ ãã®è¨äºã¯ãCBcloud ã¢ããã³ãã«ã¬ã³ãã¼( https://qiita.com/advent-calendar/2020/cbcloud )ã®18æ¥ç®ã®è¨äºã¨ãã¦æ稿ãã¦ãã¾ãã Batching 㧠GraphQL ã® N+1 ã解決ãã GraphQL ã§ç´ æ´ã«å®è£ ã㦠N+1 ã確èªãã ããããã¯
ãã®è¨äºã§ã¯ã並åå¦çã«é¢ããå ¥éçç¥èã解説ããã ããã«ãRubyã§éçºããã¦ããæ°ãã並åå®è¡åä½Ractorã«ãè¨åããã ã¾ãããã®è©±é¡ãããä¸ã§æ··åããã¡ãªç¨èªã«ã¤ãã¦ã¾ã¨ããã 並åå¦çï¼parallelï¼ã¨ä¸¦è¡å¦çï¼concurrentï¼ã«ã¤ã㦠並åå¦ç ã§ã¯ãããç¬éã«è¤æ°ã®å¦çãåæã«èµ°ãã 並è¡å¦ç ã§ã¯ãè¤æ°ã®å¦çãæåå²ã§é ã«å¦çããã並åå¦çã¨ã¯ç°ãªããããç¬éã«åæã«èµ°ãå¦çã¯1ã¤ã ãã ããè¤æ°ã®å¦çãå®è¡ããã¦ããã¿ã¤ãã³ã°ãæç³»åã§ç¤ºãã¨ãä¸å³ã®ãããªã¤ã¡ã¼ã¸ã«ãªãã ï¼éãç·ãããé¨åã®ã¿å¦çãå®è¡ãããï¼ ãã®è¨äºã§ã¯ä¸¦åå¦çã®åä½ã«ã¤ãã¦æ±ããã並åå¦çã®ã³ã¼ããæ¸ãã¦ãçµå±ä¸¦è¡å¦çã®ããã«åãã¦ããå ´åããããã¨ã«ã¯æ³¨æã ï¼ä¾ãã°ã1ã³ã¢ã®CPUã§ã¯2ã¤ä»¥ä¸ã®å¦çã並åã«åä½ããããã¨ã¯ã§ããªãããªã©ãï¼ ãã®è¾ºãã¯OSãVMãªã©ãè¯ãæãã«
Rubyã§ä¸¦è¡å¦çãæ¸ãããã£ãã®ã§ãããèªåã§ã¹ã¬ããã»ã¼ããªããã°ã©ã ãæ¸ããæ°ãããªãã®ã§gemãæ¢ãã¦æ¥ã¾ããã Concurrent Ruby github.com Be an 'unopinionated' toolbox that provides useful utilities without debating which is better or why ã¨æ¸ãã¦ããã®ã§ã諸ã ã®ä¸¦è¡å¦çã®å®è£ ãããã¿ããã§ããã¹ã¬ããã»ã¼ããããã§ãã READMEãèªãã¨ActorããChannelããæ¸ãã¦ããã¾ãã ã¨ããããä»åã¯ä¸çªbasicã£ã½ãAsyncã使ã£ã¦ä¸¦è¡ã§HTTPãªã¯ã¨ã¹ããæããå¦çãå®è£ ãã¦ã¿ã¾ãã Async Async: A mixin module that provides simple asynchronous behavior to a cla
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}