-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hax] Using more abstract notion of type
Signed-off-by: John Schaeffer <[email protected]>
- Loading branch information
1 parent
f6fca06
commit 3c286bd
Showing
10 changed files
with
191 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package query | ||
|
||
import ( | ||
"github.com/google/uuid" | ||
"go.infratographer.com/permissions-api/internal/types" | ||
) | ||
|
||
func newRoleFromTemplate(t types.RoleTemplate) types.Role { | ||
out := types.Role{ | ||
ID: uuid.New(), | ||
Actions: t.Actions, | ||
} | ||
|
||
return out | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package query | ||
|
||
import "github.com/authzed/authzed-go/v1" | ||
|
||
// Engine represents a client for making permissions queries. | ||
type Engine struct { | ||
namespace string | ||
client *authzed.Client | ||
} | ||
|
||
func NewEngine(namespace string, client *authzed.Client) *Engine { | ||
return &Engine{ | ||
namespace: namespace, | ||
client: client, | ||
} | ||
} |
Oops, something went wrong.