daf4d4b94b
draft pr for the test demo harness for permit.io * harness working for permit.io demo * user is const * aws profile * permit import code for research * cleanup * create user tool poc * Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/permit-io-demo * tests for user creation * add audit logs and dry-run * add tests sanity check the requested roles * update docs for delete * disable/enable users and test * more tests and make user name required only for create operations * clean up * add docs * aws tag tests * audit -> slog * attempt build fix devbox * edit * just devbox * remove lock change for merge * Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/permit-io-demo
28 lines
517 B
Go
28 lines
517 B
Go
package api
|
|
|
|
const DefaultPerPageLimit = 100
|
|
|
|
func isPaginationInLimit(page int32, perPage int32, perPageLimit int32) bool {
|
|
return perPage <= perPageLimit && perPage > 0 && page > 0
|
|
}
|
|
|
|
func listToString(list []string) string {
|
|
var str string
|
|
for _, s := range list {
|
|
str += s + ","
|
|
}
|
|
return str
|
|
}
|
|
|
|
func getSchemaFromUrl(url string) string {
|
|
if url[0:5] == "https" {
|
|
return "https"
|
|
}
|
|
return "http"
|
|
}
|
|
|
|
func getHostFromUrl(url string) string {
|
|
schema := getSchemaFromUrl(url)
|
|
return url[len(schema)+3:]
|
|
}
|