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

BC-8137 - move auth rules into modules #5271

Merged
merged 29 commits into from
Oct 22, 2024

Conversation

Metauriel
Copy link
Contributor

@Metauriel Metauriel commented Oct 2, 2024

Description

Links to Tickets or other pull requests

Changes

Datasecurity

Deployment

New Repos, NPM pakages or vendor scripts

Approval for review

  • DEV: If api was changed - generate-client:server was executed in vue frontend and changes were tested and put in a PR with the same branch name.
  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.


@Injectable()
export class TeamAuthorisableService implements AuthorizationLoaderServiceGeneric<TeamEntity> {
constructor(private readonly teamsRepo: TeamsRepo) {}
constructor(private readonly teamsRepo: TeamsRepo, injectionService: AuthorizationInjectionService) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hier ist auch domain vs api layer ein Problem.

@@ -3,9 +3,10 @@ import { TeamsRepo } from '@shared/repo';
import { LoggerModule } from '@src/core/logger';
import { CqrsModule } from '@nestjs/cqrs';
import { TeamAuthorisableService, TeamService } from './service';
import { AuthorizationModule } from '../authorization';
Copy link
Contributor

Choose a reason for hiding this comment

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

@modules/authorization

user,
role,
const user: User = userFactory.build({ roles: [role], school });
return {
Copy link
Contributor

Choose a reason for hiding this comment

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

Empty line before return.

],
providers: [
ContextExternalToolService,
ContextExternalToolValidationService,
ContextExternalToolAuthorizableService,
ToolReferenceService,
ToolConfigurationStatusService,
ContextExternalToolRule,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ich schätze in den Modulen ist auch keine saubere Grenze zwichen api und domain Module gewahrt. Bzw. das api war bisher nicht vorhanden da der api Part (die Rule) sich im Authorization Module versteckt hatte.

Ich finde es allerdings unglücklich das jetzt im Domain Module zu platzieren. Das räumt später nie wieder einer auf und wird im schlimmsten Fall noch adaptiert.

Edit: Ich könnte schwören das wir in irgendein Team Review mal angemerkt hatten, das contextExternalToolAuthorizableService aus dem context-external-tool.module.ts raus muss.

Das zieht sich dann so durch im Tool Module.

import { SchoolExternalTool } from '../domain';

@Injectable()
export class SchoolExternalToolAuthorizableService implements AuthorizationLoaderServiceGeneric<SchoolExternalTool> {
Copy link
Contributor

Choose a reason for hiding this comment

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

AuthorizationLoaderServiceGeneric sollte eigentlich auch bereits entfernt werden und durch AuthorizationLoaderService ersetzt werden. Ich sehe erstmal kein Grund das sich bei Tools nicht direkt verwenden lässt. Da die Domain Objekte alle von AuthorizableObject extenden.

Hier wäre schön wenn du noch mal schauen könntest, ob sich das direkt überall in Tools austauschen lässt.

Edit: Eigentlich sogar in allen Bereichen das ist ja jetzt sogar in group, instance und course-do.service gelandet...

Evtl. aber eine Arbeit für ein extra Ticket, sicher schnell gemacht. Aber anderer Fokus.
Todo: Ticket erstellen, wer erstellt es?

@hoeppner-dataport hoeppner-dataport changed the title Bc 8137 move auth rules into modules BC-8137 - move auth rules into modules Oct 21, 2024
Copy link

@Metauriel Metauriel merged commit 23f1326 into main Oct 22, 2024
134 checks passed
@Metauriel Metauriel deleted the BC-8137-move-auth-rules-into-modules branch October 22, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants