Skip to content

Access Manager 2.0 #174

@milosmns

Description

@milosmns

Provide a brief summary of the planned work

Access Manager is used for authentication and authorization today, as well as feature management and dependency control. As a result of various migrations, the current implementation has become challenging to manage and understand.

We should refactor it to simplify and improve.

Detailed overview

Some improvement areas include:

  • Should we have multiple functions for user and project and creators and …? Would it be better to have a single function with a clean API? Example:
val accessResult: AccessResult<User> = accessManager.requestAccess(
  targetType = Targets.USER,
  targetId = request.path.userId,
  targetPermission = Permissions.USER_WRITE_DATA,
  credentials = request.token,
)

if (accessResult.isForbidden) throwForbidden("Unauthorized")

val user = accessResult.content
  • Separate access manager for Creators? It would make the first point obsolete, but may be a better approach.
    • A common interface for creators and consumers, as mentioned in the first point, with two/different implementations?

Hint/location:

com.appifyhub.monolith.features.auth.domain.access.AccessManager

List the acceptance criteria

  • Access manager has a lower complexity
  • Access manager tests are easier to understand
  • Dependent code was updated to reflect these changes
  • Tests were updated to reflect these changes, and passing
  • Documentation is updated to reflect these changes (if needed)

Include any additional notes (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestPlannedPlanned and roadmapped work

    Type

    No type

    Projects

    Status

    Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions