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

feat: introduce grant entity #249

Merged
merged 15 commits into from
Aug 26, 2022
Merged

feat: introduce grant entity #249

merged 15 commits into from
Aug 26, 2022

Conversation

rahmatrhd
Copy link
Member

@rahmatrhd rahmatrhd commented Aug 8, 2022

release 1 for #246

Checklist

  • list accesses API
  • list user accesses API
  • get access API
  • revoke access API (also still update the appeal status to terminated)
  • revoke accesses API (also still update the appeal status to terminated)
  • update access status to inactive when revoking appeal
  • create access entry when appeal is activated
    • create access on appeal creation with auto approval
    • create access on final approval update
  • deprecate revoke appeal and bulk revoke appeals APIs
appeal status access status business logic changes db migration
pending N/A - -
canceled N/A - -
rejected N/A - -
active active create access entry when the appeal is activated active appeals will be migrated to active access
terminated inactive revoking active appeal or access will change the status of both entities, appeal -> terminated, access -> inactive terminated appeal records will be migrated to inactive access records along with the revoked_at, revoked_by, and revoke_reason information

@coveralls
Copy link

coveralls commented Aug 16, 2022

Pull Request Test Coverage Report for Build 2916385434

  • 278 of 588 (47.28%) changed or added relevant lines in 17 files are covered.
  • 24 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-2.5%) to 73.579%

Changes Missing Coverage Covered Lines Changed/Added Lines %
api/handler/v1beta1/adapter.go 45 49 91.84%
core/access/option.go 0 18 0.0%
internal/store/postgres/access_repository.go 58 80 72.5%
core/appeal/service.go 72 122 59.02%
api/handler/v1beta1/access.go 47 115 40.87%
core/access/service.go 19 167 11.38%
Files with Coverage Reduction New Missed Lines %
core/provider/service.go 8 62.79%
core/appeal/service.go 16 54.82%
Totals Coverage Status
Change from base Build 2859177105: -2.5%
Covered Lines: 5723
Relevant Lines: 7778

💛 - Coveralls

@bsushmith
Copy link
Member

62 files 😮

api/handler/v1beta1/adapter.go Outdated Show resolved Hide resolved
core/access/option.go Show resolved Hide resolved
core/access/service.go Outdated Show resolved Hide resolved
core/access/service.go Show resolved Hide resolved
core/appeal/service.go Outdated Show resolved Hide resolved
internal/store/postgres/model/access.go Outdated Show resolved Hide resolved
@mabdh
Copy link
Member

mabdh commented Aug 16, 2022

Can we please specify, what things that could break and what things that should do to acomodate this changes?

@rahmatrhd rahmatrhd requested a review from mabdh August 23, 2022 17:57
@rahmatrhd rahmatrhd linked an issue Aug 24, 2022 that may be closed by this pull request
@ravisuhag
Copy link
Member

@rahmatrhd @mabdh We can merge this. But based on how the decision goes for #171, we should think of the right name for this entity. I think grant is a better name for this instead of access. access can get confusing as the entire Guardian itself is about access.

@ravisuhag ravisuhag merged commit 18f515d into main Aug 26, 2022
@ravisuhag ravisuhag deleted the decouple-appeal-access branch August 26, 2022 12:44
@rahmatrhd rahmatrhd added this to the v0.4 milestone Aug 28, 2022
@rahmatrhd rahmatrhd changed the title feat: introduce access entity feat: introduce grant entity Sep 7, 2022
haveiss pushed a commit that referenced this pull request Oct 21, 2022
* feat: introduce access entity

* chore: handle access creation on creating appeal (with auto approval) and updating approval

* chore: add role field in access and filter by permissions in List

* chore: validate appeal extension using existing active access

* chore: change provider service signature for grant/revoke to receive access instead of appeal

* chore: update error message

* feat: add access revoke and bulk revoke API

* test: fix test cases

* chore: add null check for access.Appeal

* refactor: rename isEligibleToExtend to checkExtensionEligibility

* fix: fix gorm annotation for ID field

* feat: add list user accesses api

* refactor: add nil checking in ToAccessProto

* fix: fix ToAccessProto usage

* refactor: remove unnecessary boolean return
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.

Decouple access management from appeal
5 participants