Skip to content

Commit

Permalink
revert: change actor id to creator id in polcy create
Browse files Browse the repository at this point in the history
  • Loading branch information
Lodek committed Jun 11, 2024
1 parent d0db457 commit 9308ad2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions acp/acp_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ func (l *ACPLocal) Close() error {

func (l *ACPLocal) AddPolicy(
ctx context.Context,
actorID string,
creatorID string,
policy string,
creationTime *protoTypes.Timestamp,
) (string, error) {
principal, err := auth.NewDIDPrincipal(actorID)
principal, err := auth.NewDIDPrincipal(creatorID)
if err != nil {
return "", newErrInvalidActorID(err, actorID)
return "", newErrInvalidActorID(err, creatorID)
}
ctx = auth.InjectPrincipal(ctx, principal)

Expand Down
9 changes: 6 additions & 3 deletions net/peer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ func TestSetReplicatorWithACollectionSpecifiedThatHasPolicy_ReturnError(t *testi
privKeyBytes, err := hex.DecodeString("028d53f37a19afb9a0dbc5b4be30c65731479ee8cfa0c9bc8f8bf198cc3c075f")
require.NoError(t, err)
privKey := secp256k1.PrivKeyFromBytes(privKeyBytes)
identity := acpIdentity.FromPrivateKey(privKey)
identity, err := acpIdentity.FromPrivateKey(privKey)
require.NoError(t, err)

ctx = db.SetContextIdentity(ctx, identity)
policyResult, err := d.AddPolicy(ctx, policy)
Expand Down Expand Up @@ -436,7 +437,8 @@ func TestSetReplicatorWithSomeCollectionThatHasPolicyUsingAllCollectionsByDefaul
privKeyBytes, err := hex.DecodeString("028d53f37a19afb9a0dbc5b4be30c65731479ee8cfa0c9bc8f8bf198cc3c075f")
require.NoError(t, err)
privKey := secp256k1.PrivKeyFromBytes(privKeyBytes)
identity := acpIdentity.FromPrivateKey(privKey)
identity, err := acpIdentity.FromPrivateKey(privKey)
require.NoError(t, err)

ctx = db.SetContextIdentity(ctx, identity)
policyResult, err := d.AddPolicy(ctx, policy)
Expand Down Expand Up @@ -802,7 +804,8 @@ func TestAddP2PCollectionsWithPermissionedCollection_Error(t *testing.T) {
privKeyBytes, err := hex.DecodeString("028d53f37a19afb9a0dbc5b4be30c65731479ee8cfa0c9bc8f8bf198cc3c075f")
require.NoError(t, err)
privKey := secp256k1.PrivKeyFromBytes(privKeyBytes)
identity := acpIdentity.FromPrivateKey(privKey)
identity, err := acpIdentity.FromPrivateKey(privKey)
require.NoError(t, err)

ctx = db.SetContextIdentity(ctx, identity)
policyResult, err := d.AddPolicy(ctx, policy)
Expand Down

0 comments on commit 9308ad2

Please sign in to comment.