mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 20:29:54 -06:00
add sessions to report
This commit is contained in:
@@ -2,4 +2,5 @@ Enhancement: GDPR Export
|
||||
|
||||
Adds an endpoint to collect all data that is related to a user
|
||||
|
||||
https://github.com/owncloud/ocis/pull/6064
|
||||
https://github.com/owncloud/ocis/pull/5950
|
||||
|
||||
@@ -132,14 +132,14 @@ func (c *ConcreteClient) GetPIIReport(ctx context.Context, realm string, email s
|
||||
return nil, err
|
||||
}
|
||||
|
||||
creds, err := c.keycloak.GetCredentials(ctx, token.AccessToken, realm, keycloakID)
|
||||
sessions, err := c.keycloak.GetUserSessions(ctx, token.AccessToken, realm, keycloakID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &PIIReport{
|
||||
UserData: u,
|
||||
Credentials: creds,
|
||||
UserData: u,
|
||||
Sessions: sessions,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,5 @@ type GoCloak interface {
|
||||
LoginClient(ctx context.Context, clientID, clientSecret, realm string) (*gocloak.JWT, error)
|
||||
RetrospectToken(ctx context.Context, accessToken, clientID, clientSecret, realm string) (*gocloak.IntroSpectTokenResult, error)
|
||||
GetCredentials(ctx context.Context, accessToken, realm, userID string) ([]*gocloak.CredentialRepresentation, error)
|
||||
GetUserSessions(ctx context.Context, token, realm, userID string) ([]*gocloak.UserSessionRepresentation, error)
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ var userActionsToString = map[UserAction]string{
|
||||
|
||||
// PIIReport is a structure of all the PersonalIdentifiableInformation contained in keycloak.
|
||||
type PIIReport struct {
|
||||
UserData *libregraph.User `json:"user_data,omitempty"`
|
||||
Credentials []*gocloak.CredentialRepresentation `json:"credentials,omitempty"`
|
||||
UserData *libregraph.User
|
||||
Sessions []*gocloak.UserSessionRepresentation
|
||||
}
|
||||
|
||||
// Client represents a keycloak client.
|
||||
|
||||
Reference in New Issue
Block a user