Skip to content

Commit

Permalink
fix: fix guardian issues (#295)
Browse files Browse the repository at this point in the history
* fix: fix guardian issues

* chore: resolve feedback

* chore: use appeals.updated_at for grants.created_at value

* fix: fix format

Co-authored-by: Rahmat Hidayat <[email protected]>
  • Loading branch information
singhvikash11 and rahmatrhd authored Oct 3, 2022
1 parent 3d9c118 commit 82f2b11
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions api/handler/v1beta1/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ func (a *adapter) ToPolicyAppealConfigProto(p *domain.Policy) *guardianv1beta1.P
}
}
policyAppealConfigProto.DurationOptions = durationOptions
policyAppealConfigProto.AllowOnBehalf = p.AppealConfig.AllowOnBehalf
return policyAppealConfigProto
}

Expand Down
1 change: 0 additions & 1 deletion api/handler/v1beta1/grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package v1beta1
import (
"context"
"errors"

guardianv1beta1 "github.com/odpf/guardian/api/proto/odpf/guardian/v1beta1"
"github.com/odpf/guardian/core/grant"
"github.com/odpf/guardian/domain"
Expand Down
2 changes: 1 addition & 1 deletion core/grant/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type notifier interface {
}

type grantCreation struct {
AppealStatus string `validate:"required,eq=active"`
AppealStatus string `validate:"required,eq=approved"`
AccountID string `validate:"required"`
AccountType string `validate:"required"`
ResourceID string `validate:"required"`
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -971,10 +971,6 @@ github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba/go.mod h1:
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/odpf/salt v0.0.0-20220530022224-80e391d2e38a h1:c0jaoXLGTITEqmROjOIeiaRyk08gjxd9R3WhqAaxyvw=
github.com/odpf/salt v0.0.0-20220530022224-80e391d2e38a/go.mod h1:ZY9yXIHZYlYbQGKV5WSGmyYnw+NtQEzl6z0Tj0dto8M=
github.com/odpf/salt v0.0.0-20220820210649-284059fe57e6 h1:mzEt6On7rWj7fzKZs0ZdOcuHQFxB3MxurhbA2JHr1YI=
github.com/odpf/salt v0.0.0-20220820210649-284059fe57e6/go.mod h1:iH1ZB+lBmI5E5DgSCu9HjMmNcSvUe0zCusZJzOF2Yfk=
github.com/odpf/salt v0.1.1-0.20220821030850-77ce10e39145 h1:MML18OvRZhDDdh/m9u3LGutieRnPZPuGOJMtKkbSl+I=
github.com/odpf/salt v0.1.1-0.20220821030850-77ce10e39145/go.mod h1:iH1ZB+lBmI5E5DgSCu9HjMmNcSvUe0zCusZJzOF2Yfk=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ SELECT
"revoked_at",
"revoke_reason",
"created_by",
NOW() AS "created_at",
NOW() AS "updated_at"
"updated_at" AS "created_at",
"updated_at"
FROM
"appeals"
WHERE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ UPDATE
SET
"status" = 'approved'
WHERE
"status" = 'terminated';
"status" in ('terminated', 'active');

ALTER TABLE
"appeals" DROP COLUMN IF EXISTS "revoked_by",
Expand Down
1 change: 0 additions & 1 deletion jobs/grant_expiration_reminder.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func (h *handler) GrantExpirationReminder(ctx context.Context) error {
for _, err1 := range errs {
h.logger.Error("failed to send notifications", "error", err1)
}
return nil
}
}

Expand Down

0 comments on commit 82f2b11

Please sign in to comment.