Skip to content

Commit

Permalink
Merge pull request #12966 from markylaing/oidc-identities-cluster-cac…
Browse files Browse the repository at this point in the history
…he-refresh

Auth: Notify cluster members of new or updated OIDC identities
  • Loading branch information
tomponline authored Feb 27, 2024
2 parents f83d6f0 + 350469e commit 6fb3d90
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 217 deletions.
2 changes: 1 addition & 1 deletion lxc/storage_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"

lxd "github.com/canonical/lxd/client"
"github.com/canonical/lxd/client"
"github.com/canonical/lxd/shared"
"github.com/canonical/lxd/shared/api"
cli "github.com/canonical/lxd/shared/cmd"
Expand Down
13 changes: 13 additions & 0 deletions lxd/api_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ var apiInternal = []APIEndpoint{
internalShutdownCmd,
internalSQLCmd,
internalWarningCreateCmd,
internalIdentityCacheRefreshCmd,
}

var internalShutdownCmd = APIEndpoint{
Expand Down Expand Up @@ -137,6 +138,12 @@ var internalBGPStateCmd = APIEndpoint{
Get: APIEndpointAction{Handler: internalBGPState, AccessHandler: allowPermission(entity.TypeServer, auth.EntitlementCanEdit)},
}

var internalIdentityCacheRefreshCmd = APIEndpoint{
Path: "identity-cache-refresh",

Post: APIEndpointAction{Handler: internalIdentityCacheRefresh, AccessHandler: allowPermission(entity.TypeServer, auth.EntitlementCanEdit)},
}

type internalImageOptimizePost struct {
Image api.Image `json:"image" yaml:"image"`
Pool string `json:"pool" yaml:"pool"`
Expand Down Expand Up @@ -1083,3 +1090,9 @@ func internalBGPState(d *Daemon, r *http.Request) response.Response {

return response.SyncResponse(true, s.BGP.Debug())
}

func internalIdentityCacheRefresh(d *Daemon, r *http.Request) response.Response {
logger.Debug("Received identity cache update notification - refreshing cache")
d.State().UpdateIdentityCache()
return response.EmptySyncResponse
}
Loading

0 comments on commit 6fb3d90

Please sign in to comment.