Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OY-4717 riippuvuuksien megakarsinta ja tietoturvapäivitykset #479

Open
wants to merge 61 commits into
base: master
Choose a base branch
from

Conversation

marjakari
Copy link
Contributor

Tiketin subtaskeista ilmenee tarkemmin mitä tehty, pääpiirteissään:

  • poistettu backendista toiminnallisuudet joita ei enää käytössä (vanhan hakemuspalvelun hakemusten muokkaus, esikatselu ym toiminnot)
  • korvattu haku-app-kirjasto hakemalla haku-app hakemukset suoraan documentdb-kannasta ja kopioitu tarvittavat domain-luokat
  • samassa yhteydessä poistettu vanha haku-appin testifixture ja kopioitu tarvittavilta osin testidataa haku-appin reposta
  • korvattu haku-app-kantayhteyteen käytetyt mongo-kirjastot tuoreemmilla
  • poistettu vanhentuneet apukirjastoriippuvuudet (scala-cas, scala-utils) ja kopioitu niistä tarvittavat asiat repoon
  • poistettu turhat integraatiot (vanha tarjonta, koodisto)
  • korvattu kaikissa integraatioissa scala-cas java-casilla (paitsi oppijan tunnistautuminen koska attribuuttien parsinta ei onnistu java-casilla)
  • päivitetty scala versioon 2.12 ja java versioon 17
  • päivitetty jäljellä olevat kirjastoriippuvuudet
  • otettu sähköpostin lähetystoiminnossa käyttöön uusi viestinvälityspalvelu (kirjaston avulla)
  • frontin osalta minimaaliset muutokset "ettei vaan mikään hajoa"

marjakari added 30 commits June 27, 2024 13:55
…tavat koodit repoon, poistettu group-emailer-kirjasto
…töön. Mockitoa käyttävät testit tilapäisesti kommentoitu koska vaatii versionnoston
Copy link

@vaeinoe vaeinoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Näin isoa kokonaisuutta suht. tuntemattomasta palvelusta on hankalaa lukea ihan suurennuslasilla rivi riviltä läpi, mutta ei osunut läpikäynnissä silmään mitään isompia ongelmia. Yksi mahd. korjauskohta ja muutama huomio ohessa!

Comment on lines 33 to 34
override def deleteByServiceTicket(ticket: ServiceTicket): Unit = {
override def deleteByServiceTicket(ticket: String): Unit = {
runBlocking(sqlu"""delete from sessions where ticket = ${ticket.value}""", timeout = Duration(10, TimeUnit.SECONDS))
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pitäisikö tässä olla where ticket = ${ticket} tms. jos ticket on nyt pelkkä merkkijono?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hyvä huomio! Itse asiassa nyt tuon voisi palauttaa takaisin ServiceTicket-tyyppiin. Vaihdoin välissä käyttöön Java-clientin ja siinä kohtaa muuttui ticketin tyypitys, mutta sitten piti kuitenkin palauttaa scala-client käyttöön.

application.getState.toString,
isPostProcessing(application),
Option(application.getRequiredPaymentState).map(_.toString)
Application.State.SUBMITTED.toString // TODO fix voiko olla kovakoodattu vai tarvitaanko päättely
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yleishuomiona: TODOja on vielä aika paljon - oli varmaan tarkoituskin, mutta muistutuksena että kannattanee grepata ja katsoa läpi tarkkaan ennen lopullisia testejä ja tuotantoonvientiä. 😊

@@ -73,13 +57,15 @@ trait ApplicationsServletContainer {
val oid = personOid()
hakemusEditori.fetchByPersonOid(request, oid, Fetch) match {
case FullSuccess(hakemukset) =>
logger.info("ApplicationsServlet get FullSuccess")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jos nämä ovat jäämässä tuotantoon saakka, pitäisikö näissä lokittaa myös jotain tietoa siitä mitä koetettiin hakea (henkilön oid)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ei ollut tarkoitus jättää ja tuossa siis haettiin hakemuksia henkilö-oidilla.

Comment on lines 98 to 100
.withKayttooikeusRajoitukset(ViestinvalitysBuilder.kayttooikeusrajoituksetBuilder()
.withKayttooikeus("APP_HAKEMUS_CRUD", "1.2.246.562.10.240484683010")
.build())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pitäisiköhän tähän lisätä varmuudeksi kommentti jälkipolville mistä taikasanoissa (oikeus ja organisaatio) on kyse?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hei tästä huomiosta papukaijamerkki! Tuohon itse asiassa oli jäänyt copypaste-härönä ihan väärät oikat!

// jos ei löydy atarusta, haetaan haku-appista
val optFromHakemusRepository = hakemusRepository.getHakemus(request, hakemusOid, valintatulosFetchStrategy)
if (optFromHakemusRepository.isEmpty) {
logger.info("fetchByHakemusOid(): Hakemus repository returned no application for given hakemusOid {}. Searching from ataru.", hakemusOid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pikkujuttu, mutta Searching from atarun voisi siivoilla.

class KoodistoServlet extends OmatSivutServletBase with JacksonJsonSupport with JsonFormats {
before() {
contentType = formats("json")
}

get("/postitoimipaikka/:postalCode") {
checkNotFound(koodistoService.postOffice(params("postalCode"), language))
NotFound("error" -> "Not found") // ei pitäisi enää tarvita tätä
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jos ei tosiaan tarvita tätä enää, ehkä voisi siivota järeämminkin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En tainnut alunperin uskaltaa poistaa kun oli viittauksia fronttipuolella, mutta mäkeen vaan.

}

get("/koulutus/:aoId") {
checkNotFound(koulutusInformaatioService.koulutus(params("aoId"), getLangParam("lang")))
NotFound("error" -> "Not found")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Siivousta näillekin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tähänkin taisi olla jotain viittauksia frontissa jäljellä mutta lienee kuollutta koodia

@@ -83,6 +79,7 @@ trait NonSensitiveApplicationServletContainer {
}

private def jwtAuthorize: Try[HakemusJWT] = {
logger.info(s"tunnistaudutaan jwt:llä")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haiskahtaa vähän ylimääräiseltä lokitukselta

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oli jäänyt testailusta näköjään

private def fetchHakemus(hakemusOid: String, personOid: Option[String]): Try[HakemusInfo] = {
logger.info(s"haetaan legacy-hakemus hakemus-oidilla $hakemusOid")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kai tämä palauttaa muutakin kuin legacy-hakemuksia?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tuokin oli tarkoitettu tilapäiseksi kun testailin haku-appin hakemuksia





Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ovatko nämä käytössä jossain? En nopealla vilkaisulla löytänyt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totta, ei enää olekaan kun päivitin apit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants