@@ -125,14 +125,14 @@ func (c *cs3backend) GetUserByClaims(ctx context.Context, claim, value string) (
125125 switch {
126126 case err != nil :
127127 return nil , "" , fmt .Errorf ("could not get user by claim %v with value %v: %w" , claim , value , err )
128- case res .Status . Code != rpcv1beta1 .Code_CODE_OK :
129- if res .Status . Code == rpcv1beta1 .Code_CODE_NOT_FOUND {
128+ case res .GetStatus (). GetCode () != rpcv1beta1 .Code_CODE_OK :
129+ if res .GetStatus (). GetCode () == rpcv1beta1 .Code_CODE_NOT_FOUND {
130130 return nil , "" , ErrAccountNotFound
131131 }
132132 return nil , "" , fmt .Errorf ("could not get user by claim %v with value %v : %s " , claim , value , res .GetStatus ().GetMessage ())
133133 }
134134
135- user := res .User
135+ user := res .GetUser ()
136136
137137 return user , res .GetToken (), nil
138138}
@@ -152,11 +152,11 @@ func (c *cs3backend) Authenticate(ctx context.Context, username string, password
152152 switch {
153153 case err != nil :
154154 return nil , "" , fmt .Errorf ("could not authenticate with username and password user: %s, %w" , username , err )
155- case res .Status . Code != rpcv1beta1 .Code_CODE_OK :
155+ case res .GetStatus (). GetCode () != rpcv1beta1 .Code_CODE_OK :
156156 return nil , "" , fmt .Errorf ("could not authenticate with username and password user: %s, got code: %d" , username , res .GetStatus ().GetCode ())
157157 }
158158
159- return res .User , res .Token , nil
159+ return res .GetUser () , res .GetToken () , nil
160160}
161161
162162// CreateUserFromClaims creates a new user via libregraph users API, taking the
@@ -235,7 +235,7 @@ func (c *cs3backend) CreateUserFromClaims(ctx context.Context, claims map[string
235235 return & cs3UserCreated , nil
236236}
237237
238- func (c cs3backend ) UpdateUserIfNeeded (ctx context.Context , user * cs3.User , claims map [string ]interface {}) error {
238+ func (c * cs3backend ) UpdateUserIfNeeded (ctx context.Context , user * cs3.User , claims map [string ]interface {}) error {
239239 newUser , err := c .libregraphUserFromClaims (claims )
240240 if err != nil {
241241 c .logger .Error ().Err (err ).Interface ("claims" , claims ).Msg ("Error converting claims to user" )
@@ -260,7 +260,7 @@ func (c cs3backend) UpdateUserIfNeeded(ctx context.Context, user *cs3.User, clai
260260}
261261
262262// SyncGroupMemberships maintains a users group memberships based on an OIDC claim
263- func (c cs3backend ) SyncGroupMemberships (ctx context.Context , user * cs3.User , claims map [string ]interface {}) error {
263+ func (c * cs3backend ) SyncGroupMemberships (ctx context.Context , user * cs3.User , claims map [string ]interface {}) error {
264264 gatewayClient , err := c .gatewaySelector .Next ()
265265 if err != nil {
266266 c .logger .Error ().Err (err ).Msg ("could not select next gateway client" )
@@ -378,7 +378,7 @@ func (c cs3backend) SyncGroupMemberships(ctx context.Context, user *cs3.User, cl
378378 return nil
379379}
380380
381- func (c cs3backend ) getLibregraphGroup (ctx context.Context , client * libregraph.APIClient , group string ) (* libregraph.Group , error ) {
381+ func (c * cs3backend ) getLibregraphGroup (ctx context.Context , client * libregraph.APIClient , group string ) (* libregraph.Group , error ) {
382382 lgGroup , resp , err := client .GroupApi .GetGroup (ctx , group ).Execute ()
383383 if resp != nil {
384384 defer resp .Body .Close ()
@@ -396,7 +396,7 @@ func (c cs3backend) getLibregraphGroup(ctx context.Context, client *libregraph.A
396396 return lgGroup , nil
397397}
398398
399- func (c cs3backend ) updateLibregraphUser (userid string , user libregraph.UserUpdate ) error {
399+ func (c * cs3backend ) updateLibregraphUser (userid string , user libregraph.UserUpdate ) error {
400400 gatewayClient , err := c .gatewaySelector .Next ()
401401 if err != nil {
402402 c .logger .Error ().Err (err ).Msg ("could not select next gateway client" )
@@ -427,7 +427,7 @@ func (c cs3backend) updateLibregraphUser(userid string, user libregraph.UserUpda
427427 return nil
428428}
429429
430- func (c cs3backend ) setupLibregraphClient (ctx context.Context , cs3token string ) (* libregraph.APIClient , error ) {
430+ func (c * cs3backend ) setupLibregraphClient (ctx context.Context , cs3token string ) (* libregraph.APIClient , error ) {
431431 // Use micro registry to resolve next graph service endpoint
432432 next , err := c .graphSelector .Select ("com.owncloud.web.graph" )
433433 if err != nil {
@@ -454,7 +454,7 @@ func (c cs3backend) setupLibregraphClient(ctx context.Context, cs3token string)
454454 return libregraph .NewAPIClient (lgconf ), nil
455455}
456456
457- func (c cs3backend ) isAlreadyExists (resp * http.Response ) (bool , error ) {
457+ func (c * cs3backend ) isAlreadyExists (resp * http.Response ) (bool , error ) {
458458 oDataErr := libregraph .NewOdataErrorWithDefaults ()
459459 body , err := io .ReadAll (resp .Body )
460460 if err != nil {
@@ -475,7 +475,7 @@ func (c cs3backend) isAlreadyExists(resp *http.Response) (bool, error) {
475475 return false , nil
476476}
477477
478- func (c cs3backend ) libregraphUserFromClaims (claims map [string ]interface {}) (libregraph.User , error ) {
478+ func (c * cs3backend ) libregraphUserFromClaims (claims map [string ]interface {}) (libregraph.User , error ) {
479479 user := libregraph.User {}
480480 if dn , ok := claims [c .autoProvisionClaims .DisplayName ].(string ); ok {
481481 user .SetDisplayName (dn )
@@ -505,7 +505,7 @@ func (c cs3backend) libregraphUserFromClaims(claims map[string]interface{}) (lib
505505 return user , nil
506506}
507507
508- func (c cs3backend ) cs3UserFromLibregraph (_ context.Context , lu * libregraph.User ) cs3.User {
508+ func (c * cs3backend ) cs3UserFromLibregraph (_ context.Context , lu * libregraph.User ) cs3.User {
509509 cs3id := cs3.UserId {
510510 Type : cs3 .UserType_USER_TYPE_PRIMARY ,
511511 Idp : c .oidcISS ,
0 commit comments