Upgrade to Pro — share decks privately, control downloads, hide ads and more …

安全なPlay Frameworkのバージョンアップの仕方

安全なPlay Frameworkのバージョンアップの仕方

Scala福岡2017 発表資料

KASUYA, Daisuke

July 29, 2017
Tweet

More Decks by KASUYA, Daisuke

Other Decks in Programming

Transcript

  1. ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ ͜ͷߨԋʹ͍ͭͯ ▸ Mackerel͸ݱࡏplay2.5.xͰಈ࡞ ▸ (ͦΖͦΖ2.6΋ߟ͍͑ͨͰ͢Ͷ…) ▸ 2.3 ->

    2.4 ੒ޭ (͔͠͠՝୊͕͋ͬͨ) ▸ 2.4 -> 2.5 ੒ޭ ▸ ͜ͷมભΛ੺དʑʹ͓ಧ͚͠·͢ ▸ ςοΫཁૉ͸গͳΊͰ͢
  2. MackerelͰͷPlay Frameworkͷมભ ▸ Play Framework 2.2.1 Ͱ։ൃ։࢝ ▸ ϦϦʔε࣌఺Ͱ͸ Play

    2.3.1 ▸ ͦͷޙ 2.3.7 ·ͰͷϚΠφʔΞοϓσʔτ͸େ͖ͳ໰୊΋ͳ ͘௥ਵ ▸ ͞ΕɺͦΖͦΖ 2.4.x ʹ͍ͨ͠ͳ… ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ
  3. Play FrameworkΛ2.4.xʹ͢Δඞཁੑ ▸ Mackerel͸10೥ޙ΋౰ͨΓલͷΑ͏ʹಈ͍ͯͳ͍ͱ͍͚ͳ͍ϓϩμ Ϋτ ▸ 2027೥ͱ͔ʹMackerel͕10೥લͷٕज़Ͱಈ͍͍͍͍ͯͯΘ͚ͳ͍ Ͱ͢ΑͶ ▸ Play2.3ͷWS(HTTPΫϥΠΞϯτ)ʹೖ͍ͬͯΔσϑΥϧτೝূہ৘

    ใ͕ݹ͘ͳΓɺWebhook௨஌ͷॲཧͳͲʹࢧো͕Ͱ͸͡Ί͍ͯͨ ▸ ϑϧελοΫͳϑϨʔϜϫʔΫͳͷͰɺҰ෦ͷϥΠϒϥϦ͚ͩࡌͤ ସ͑ΔΑΓશମΛΞοϓσʔτͨ͠΄͏͕Αͦ͞͏ ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ
  4. Play2.3.x -> 2.4.x ҠߦͷେมϙΠϯτ ▸ ίωΫγϣϯϓʔϧ͕BoneCP ͔Β HikariCPʹ ▸ ࡉ͔͍ઃఆͳͲͷνϡʔχϯάΛ΍Γͳ͓͢ඞཁ͕͋Δ

    ▸ Slick2.x -> Slick3.x ▸ DBIOͱ͍͏ඇಉظϕʔεͳΫΤϦॲཧʹ ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ
  5. Slick2.x -> Slick3.x ▸ Slick3.x͸ඇಉظ͕ϕʔε ▸ Mackerel͸Slick2.xͰϒϩοΩϯάͳΫΤϦॲཧ ▸ MackerelͷSQL͍ͭ͋͘ΔΜ΍…(਺͑ͨ͘ͳ͍͔Β਺͑ͯ ͳ͍

    ▸ ͜ΕΛීஈͷػೳ։ൃ͠ͳ͕Βશ෦ඇಉظʹஔ͖׵͑Δ ͷ…ʁ ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ
  6. Slick2.x -> Slick3.x ▸ ຖिϦϦʔε͠ͳ͕ΒDBIOͷஔ͖׵͑Ͱ͖Δͷ͔ʁ ▸ ຖिͷػೳ։ൃͱίϯϑϦΫτ͠ͳ͍Α͏ʹ΍ΕΔʁ ▸ ແཧͦ͏… ▸

    play2.4ԽͨͼͨͼνϟϨϯδ͢Δ͕ɺͲ͏ͯ͠΋Slickͷ όʔδϣϯΞοϓ͕ωοΫʹͳͬͯఫୀΛ܁Γฦ͢ ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ
  7. Play2.4 Ҡߦେ࡞ઓ ▸ ϦϦʔε͸Ր༵೔ͷఆظϦϦʔε೔ʹ࣮ࢪ ▸ ໦༵೔ͷఆظϦϦʔεޙʹϚʔδ ▸ ໦ɾۚɾ౔ɾ೔ɾ݄ͷ5೔ؒεςʔδϯά؀ڥͰಈ࡞ͤ͞ ͯͦͷظؒͷϝτϦοΫΛݟΔ ▸

    ௨ৗͷఆظϦϦʔε޲͚ͷP-R͸ͦͷ೔ʹ͸Ϛʔδͤͣ play2.4ͷP-R͚ͩϦϦʔε͢Δ(໰୊ͷ੾Γ෼͚Λ໌֬Խ ͢ΔͨΊ) ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ
  8. Կ͔͓͔͍͠… ▸ Play2.4ͷϚΠάϨʔγϣϯΨΠυΑΓ ▸ Play 2.4 uses a new encryption

    format, but it can read data encrypted by earlier versions of Play. However, earlier versions of Play will not be able to read data encrypted by Play 2.4. ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ https://www.playframework.com/documentation/2.4.x/Migration24#Crypto-APIs
  9. Կ͔͓͔͍͠… ▸ Play2.4ͷϚΠάϨʔγϣϯΨΠυΑΓ ▸ Play 2.4 uses a new encryption

    format, but it can read data encrypted by earlier versions of Play. However, earlier versions of Play will not be able to read data encrypted by Play 2.4. ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ https://www.playframework.com/documentation/2.4.x/Migration24#Crypto-APIs Play 2.4͸৽͍͠҉߸ԽܗࣜΛ࢖༻͠·͕͢ɺҎલͷόʔδϣϯͷPlayͰ ҉߸Խ͞ΕͨσʔλΛಡΈऔΔ͜ͱ͕Ͱ͖·͢ɻ ͨͩ͠ɺҎલͷόʔ δϣϯͷPlayͰ͸ɺPlay 2.4Ͱ҉߸Խ͞ΕͨσʔλΛಡΈऔΔ͜ͱ͕Ͱ͖ ·ͤΜɻ
  10. ҠߦৼΓฦΓձ (YWT) ͷٞࣄ࿥ΑΓҰ෦ൈਮ ▸ Play2.5Ҡߦ࣌ʹ΍Δ͜ͱ ▸ ϚΠάϨʔγϣϯΨΠυΛෳ਺ਓಉ࣌ʹಡΈ߹Θͤ͢Δ ▸ ϚΠάϨʔγϣϯΨΠυΛ΋ͱʹνΣοΫϦετΛ࡞Γɺ શһϨϏϡʔ͸ͦΕΛݟͳ͕Β΍Δ

    ▸ εςʔδϯά؀ڥͰɺΧφϦΞϦϦʔεͱϩʔϧόοΫͷ ςετΛ΍Δ (ࠞࡏ؀ڥͰͷಈ࡞ -> ͔ͦ͜ΒϩʔϧόοΫ ͯ͠΋໰୊ͳ͘ಈ͔͘) ҆શͳPlay FrameworkͷόʔδϣϯΞοϓͷ࢓ํ