Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .tools/nvim/__http__/accounts/accounts.graphql.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
global:
accountName: kloudlite-dev
# global:
# accountName: kloudlite-dev
---

label: List Accounts
Expand All @@ -12,6 +12,9 @@ query: |+
displayName
creationTime
markedForDeletion
createdBy {
userEmail
}
metadata{
# labels
name
Expand All @@ -22,37 +25,33 @@ query: |+
---

label: Get Account
query: |+
query: |+ #graphql
query Accounts_getAccount($accountName: String!) {
accounts_getAccount(accountName: $accountName) {
metadata {
name
}
}
}
variables:
# accountName: "{{.accountName}}"
accountName: "sample"

variables:
accountName: "{{.accountName}}"
---

label: Create Account
query: |
mutation Accounts_createAccount($account: AccountIn!) {
accounts_createAccount(account: $account) {
apiVersion
id
isActive
kind
}
}
variables:
account:
contactEmail: "{{.email}}"
displayName: "Sample Account"
displayName: "Example Account Name"
metadata:
name: "{{.accountName}}"
spec: {}

---

Expand Down Expand Up @@ -99,7 +98,7 @@ variables:
---

lable: Check Name Availability
query: |+
query: |+ #graphql
query Accounts_checkNameAvailability($name: String!) {
accounts_checkNameAvailability(name: $name) {
result
Expand All @@ -110,6 +109,16 @@ variables:
name: sample
---

label: Ensure Kloudlite Registry Pull Secrets
query: |+ #graphql
query Query($accountName: String!) {
accounts_ensureKloudliteRegistryPullSecrets(accountName: $accountName)
}
variables:
accountName: "{{.accountName}}"

---

label: Delete Account
query: |+
mutation Accounts_deleteAccount($accountName: String!) {
Expand Down
7 changes: 4 additions & 3 deletions .tools/nvim/dap/go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ dap.configurations.go = {
request = "launch",
program = vim.g.nxt.project_root_dir .. "/apps/accounts",
args = { "--dev" },
console = "externalTerminal",
-- console = "externalTerminal",
console = "internalTerminal",
-- externalTerminal = true,
envFile = {
vim.g.nxt.project_root_dir .. "/apps/accounts" .. "/.secrets/env",
Expand Down Expand Up @@ -164,7 +165,7 @@ dap.configurations.go = {
name = "Debug Tenant Agent",
request = "launch",
program = vim.g.nxt.project_root_dir .. "/apps/tenant-agent",
args = { "--dev"},
args = { "--dev" },
console = "externalTerminal",
-- externalTerminal = true,
envFile = {
Expand All @@ -177,7 +178,7 @@ dap.configurations.go = {
name = "Debug Websocket Server",
request = "launch",
program = vim.g.nxt.project_root_dir .. "/apps/websocket-server",
args = { "--dev"},
args = { "--dev" },
console = "externalTerminal",
-- externalTerminal = true,
envFile = {
Expand Down
7 changes: 6 additions & 1 deletion .tools/taskfiles/go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ tasks:
BuiltAt:
sh: date | sed 's/\s/_/g'
Dir: "."
upx: '{{.upx | default "true" }}'
preconditions:
- sh: '[ -n "{{.Out}}" ]'
msg: var Out must have a value
cmds:
- go build -v -ldflags="-s -w -X github.com/kloudlite/api/common.BuiltAt=\"{{.BuiltAt}}\"" -o {{.Out}} {{.Dir}}
- upx {{.Out}}
# - upx --best --lzma {{.Out}}
- |+
if [ "{{.upx}}" == "true" ]; then
upx {{.Out}}
fi
5 changes: 5 additions & 0 deletions apps/accounts/internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/kloudlite/api/apps/accounts/internal/env"
"github.com/kloudlite/api/common"
"github.com/kloudlite/api/constants"
"github.com/kloudlite/api/grpc-interfaces/container_registry"
"github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts"
"github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth"
"github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms"
Expand Down Expand Up @@ -61,6 +62,10 @@ var Module = fx.Module("app",
return auth.NewAuthClient(conn)
}),

fx.Provide(func(conn ContainerRegistryClient) container_registry.ContainerRegistryClient {
return container_registry.NewContainerRegistryClient(conn)
}),

fx.Provide(func(d domain.Domain) accounts.AccountsServer {
return &accountsGrpcServer{d: d}
}),
Expand Down
153 changes: 141 additions & 12 deletions apps/accounts/internal/app/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apps/accounts/internal/app/graph/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type Query {
accounts_listMembershipsForUser: [AccountMembership!] @isLoggedInAndVerified
accounts_listMembershipsForAccount(accountName: String!, role: Github__com___kloudlite___api___apps___iam___types__Role): [AccountMembership!] @isLoggedInAndVerified
accounts_getAccountMembership(accountName: String!): AccountMembership @isLoggedInAndVerified

accounts_ensureKloudliteRegistryPullSecrets(accountName: String!): Boolean! @isLoggedInAndVerified
}

type Mutation {
Expand Down
Loading