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

chore: rebase after api changes #51

Closed
wants to merge 43 commits into from
Closed

Conversation

aranyia
Copy link
Collaborator

@aranyia aranyia commented Jun 6, 2024

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

martinconic and others added 30 commits May 20, 2024 21:47
feat: Add Act interface

feat: Add Marshal, Unmarshal skeleton

feat: Refactor AccessType to iota

feat: Add upload

feat: Rename GenerateAccessControlManifest -> create

feat: Add saltLengthIs32

feat: Add Mrshal, Unmarshal impl

feat: Add Marshal Unmarshal

feat: Remove ManifestEntry json annotations

feat: Modify to public finc/method

feat: Add ErrSaltLength

Add pkg/dynamicaccess

Refactor interfaces and implement default structs

Refactor typo

Refactor History package to use NewHistory() function

Add Act interface and default implementation

Add ACT use cases to act_ucs.md

Add new files and implement interfaces, refactor packeges

Update act_ucs.md

base usecases

Refactor access logic and add mock implementations***

Add DiffieHellman implementation and remove Keystore***

Refactor NewAccessLogic function

Replace encryption.go to pkg/encryption

Refactor packages

Update act_ucs.md

Update act_ucs.md

Update act_ucs.md

Update act_ucs.md

Update act_ucs.md
* Use DiffieHellmanMock

* Adds a comment about Get

* Add support for ECDSA public key in DiffieHellman.SharedSecret function

* Update defaultAct implementation

* Adds pseudo code for Access Logic

* Update default Act creation; Fix basic Act tests

* Refactor access logic to use new ActMock implementation

* feat(history): test mockups wip

* Refactor DiffieHellman implementation

* changes pseudocode for Diffie-Hellmann read

* Co-authored-by: Bálint Ujvári <[email protected]>

* DiffieHellman mock generates a real sherd secret

* Refactor Act

* Adds manifest lookup

* Extend act_test

* Adds unit tests, some values are mocked

* Refactor act mock impl with map[string]map[string]string

* Add check mock implementation for DiffieHellman interface

* Add Load, Store to Act interface. Refactor Act interface

* refactor act, diffieHellman mocks, tests

* Add TestLoadStore function to act_test.go

* Remove unnecessary code in Load function

* Add history mock and History lookup test

* Act refactor

Co-authored-by: Bálint Ujvári <[email protected]>

* Refactor Add method to return Act interface

* Change Get method return type to []byte

---------

Co-authored-by: Ferenc Sárai <[email protected]>
Co-authored-by: Peter Ott <[email protected]>
Co-authored-by: Bálint Ujvári <[email protected]>
Co-authored-by: Levente Kiss <[email protected]>
Co-authored-by: Roland Seres <[email protected]>
Co-authored-by: Kexort <[email protected]>
Co-authored-by: Bálint Ujvári <[email protected]>
* Use DiffieHellmanMock

* Adds a comment about Get

* Add support for ECDSA public key in DiffieHellman.SharedSecret function

* Update defaultAct implementation

* Adds pseudo code for Access Logic

* Update default Act creation; Fix basic Act tests

* Refactor access logic to use new ActMock implementation

* feat(history): test mockups wip

* Refactor DiffieHellman implementation

* changes pseudocode for Diffie-Hellmann read

* Co-authored-by: Bálint Ujvári <[email protected]>

* DiffieHellman mock generates a real sherd secret

* Refactor Act

* Adds manifest lookup

* Extend act_test

* Adds unit tests, some values are mocked

* Refactor act mock impl with map[string]map[string]string

* Add check mock implementation for DiffieHellman interface

* started Add

* changed some sig

* save

* new grantee addition handling

* mod

* changed helper function visibilities

* some mod with grantee

* test mod

* save

* no error in actInit

* Add_New_Grantee_To_Content

* comment

* copied act_test.go

* no compiler errors on our side

* Adds Add_New_Grantee_To_Content and ActInit

* almost complete grantee container

* maybe complete grantee container

* Solves merge conflict

* access-logic-merge

* fix merge issues
ZH ethersphere#106 Added context & details to use cases
* Add grantee management

* Added controller test

* Fix test fixture, refactor accesslogic

* Add UploadHandler

---------

Co-authored-by: Bálint Ujvári <[email protected]>
…. The changes have been made in the `accesslogic.go`, `act.go`, `act_test.go`, `history_test.go`, and `mock/act.go` files. (#13)

Co-authored-by: Ferenc Sárai <[email protected]>
* (refactor): ACT interface params + add doc comments

* Revert "(refactor): ACT interface params + add doc comments"

This reverts commit ee8da04.

* (refactor): ACT interface params + add doc comments

* (refactor): Add error to ACT interface methods

---------

Co-authored-by: Ferenc Sárai <[email protected]>
* (refactor): ACT interface params + add doc comments

* Revert "(refactor): ACT interface params + add doc comments"

This reverts commit ee8da04.

* (refactor): ACT interface params + add doc comments

* (refactor): Add error to ACT interface methods

* Add in-memory storage and implement Store and Load methods

* Move and refactor ACT diffieHellman to Session. Add Key and NewFromKeystore functions.

---------

Co-authored-by: Ferenc Sárai <[email protected]>
Co-authored-by: Bálint Ujvári <[email protected]>
* (refactor): ACT interface params + add doc comments

* Revert "(refactor): ACT interface params + add doc comments"

This reverts commit ee8da04.

* (refactor): ACT interface params + add doc comments

* (refactor): Add error to ACT interface methods

* Add in-memory storage and implement Store and Load methods

* *refactor) Rename defaultAct to inMemroryAct

---------

Co-authored-by: Ferenc Sárai <[email protected]>
…ession.Key to return correct dimensional byte slice (#18)

* (refactor): Update controller_test.go to use NewInMemoryAct, modify Session.Key to return two-dimensional byte slice

* (refactor:) Refactor session Key function to use append instead of index-based assignment

---------

Co-authored-by: Ferenc Sárai <[email protected]>
* grantee container and access logc tests are passed

* refactored access logic and grantee container

* PR 19 comments resolving

* Refactor

* Refactor
* grantee container and access logc tests are passed

* refactored access logic and grantee container

* PR 19 comments resolving

* Refactor

* Refactor

* working manifest ACT with basic tests

* (refactor:) Refactor act_test

* (refactor:) Refactor kvs -> kvs.manifest, kvs.memory

* (refactror:) kvs

* refactor kvs contsructors

---------

Co-authored-by: Roland Seres <[email protected]>
Co-authored-by: Bálint Ujvári <[email protected]>
Co-authored-by: Ferenc Sárai <[email protected]>
* pr comment fix

* add comment to session.NewFromKeystore
Refactors access logic

---------

Co-authored-by: Peter Ott <[email protected]>
Co-authored-by: Ferenc Sárai <[email protected]>
Co-authored-by: Bálint Ujvári <[email protected]>
Co-authored-by: Peter Ott <[email protected]>
* grantee-refactor

* Dried up code, related to AddPublisher - AddNewGranteeToContent

* Refactor

* removed getEncryptedAccessKey

* Renamed AddGrentees, RemoveGrantees, etc to Add, Remove, etc

* (refactor:) PR comments

* (refactor:) compile check

* removed encrypted_ref, grantee check (validation)

* changed interface

* comments

* some more comments

* refactor kvs and add load and store

* (refactor:) Use ref

* renamed defaultGrantee to granteeList

* removed null encrypted test in  in TestGet_Error

* refactor kvs: pass kvs IF argument instead of storing it

* Refactor according to the result of the workshop

* refactor kvs IF and mock

* fix merge errors and Logic/get_error test

* (test:) Add test for put/get after kvs.Save

---------

Co-authored-by: Roland Seres <[email protected]>
Co-authored-by: Peter Ott <[email protected]>
Co-authored-by: Ferenc Sárai <[email protected]>
Co-authored-by: Bálint Ujvári <[email protected]>
Co-authored-by: Peter Ott <[email protected]>
* (test:) Refactor tests

* (fix:) Save reset counter

---------

Co-authored-by: Ferenc Sárai <[email protected]>
Adds TestDecryptRefWithGrantee_Success and replaces generateFixPrivateKey with getPrivKey

Co-authored-by: Peter Ott <[email protected]>
* Persist grantee list on swarm
* accesslogic refactor
* Refactor grantee list tests

Co-authored-by: Roland Seres <[email protected]>
bosi95 and others added 12 commits June 6, 2024 09:46
* Refactor: newreference pattern for history, kvs, grantee

* CHG: history metadata to store granteelist reference

* History test with metadata

* Remove putter from grantee
* implement grantee management

* Add POST endpoint + fixes

* Save grantees as pubkey list and fix remove error; CHG: act-handler logger names

* Refactor: pass getter, putter to controller functions

* Refactor: error handling in dynamicaccess; Read cache header only for download handlers

* CHG: grantees ref is encrypted and added to history ref + tests

* Fix nil pointer dereference panic

* CHG: put actref in handlegrantees; Add: pin, tag,deferred headers

* CHG: pass loadsave to handlers; check if history address is nil

* FIX: re-init history so that it can be saved; only add publisher if histroy is zero

* make act timestamp optional

* fix revoke grantees

* Fix: Act timestamp header nil check; Uploadhandler UT

* Fix controller nil pointer deref

---------

Co-authored-by: Bálint Ujvári <[email protected]>
refactor: refactoring to match new linter rules according to #38

Not everything is fixed, just a reference what can and needs to be improved.

* implement grantee management

* Add POST endpoint + fixes

* Save grantees as pubkey list and fix remove error; CHG: act-handler logger names

* Refactor: pass getter, putter to controller functions

* Refactor: error handling in dynamicaccess; Read cache header only for download handlers

* CHG: grantees ref is encrypted and added to history ref + tests

* Fix nil pointer dereference panic

* CHG: put actref in handlegrantees; Add: pin, tag,deferred headers

* CHG: pass loadsave to handlers; check if history address is nil

* FIX: re-init history so that it can be saved; only add publisher if histroy is zero

* make act timestamp optional

* fix revoke grantees

* Fix: Act timestamp header nil check; Uploadhandler UT

* refactor: start refactoring for now linter rules

* refactor: revert non ACT related files

* CHG: accesslogic getkeys refactor

* refactor: fix errcheck and ineffassign linter errors in most cases

* refactor: add headers, and change error handling

* refactor: add headers

---------

Co-authored-by: Kexort <[email protected]>
Co-authored-by: Bálint Ujvári <[email protected]>
refactor(act): typos, docs, removed unused import aliases
* Refactor naming and fix remaining PR comments

* use ctx in grantees.get

* remove act_ucs.md
# Conflicts:
#	openapi/Swarm.yaml
#	openapi/SwarmDebug.yaml
#	pkg/api/router.go
@aranyia aranyia changed the base branch from act to master June 6, 2024 05:59
@aranyia aranyia changed the base branch from master to act June 6, 2024 06:02
@aranyia aranyia marked this pull request as ready for review June 6, 2024 09:00
@aranyia aranyia force-pushed the act-rebase-api-changes branch from 6a4f4f8 to 15a5eb8 Compare June 7, 2024 07:27
@aranyia aranyia closed this Jun 7, 2024
@aranyia aranyia deleted the act-rebase-api-changes branch June 7, 2024 14:44
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.