mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
device: add generic methods for working with user+session devices (#3710)
This commit is contained in:
parent
6a9d6e45e1
commit
3f9dfbef76
5 changed files with 75 additions and 36 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/pomerium/pomerium/internal/identity"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
"github.com/pomerium/pomerium/pkg/protoutil"
|
||||
"github.com/pomerium/pomerium/pkg/slices"
|
||||
)
|
||||
|
||||
// Delete deletes a session from the databroker.
|
||||
|
@ -78,3 +79,10 @@ func (x *Session) SetRawIDToken(rawIDToken string) {
|
|||
}
|
||||
x.IdToken.Raw = rawIDToken
|
||||
}
|
||||
|
||||
// RemoveDeviceCredentialID removes a device credential id.
|
||||
func (x *Session) RemoveDeviceCredentialID(deviceCredentialID string) {
|
||||
x.DeviceCredentials = slices.Filter(x.DeviceCredentials, func(el *Session_DeviceCredential) bool {
|
||||
return el.GetId() != deviceCredentialID
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue