Skip to content

Commit

Permalink
Add graph /me/changePassword endpoint
Browse files Browse the repository at this point in the history
To allow users to change their own password when using the Graph LDAP backend.

Closes:	owncloud#3063
  • Loading branch information
rhafer committed May 11, 2022
1 parent 5526d61 commit 86af09b
Show file tree
Hide file tree
Showing 13 changed files with 646 additions and 45 deletions.
1 change: 1 addition & 0 deletions extensions/graph/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ci-go-generate: $(MOCKERY) # CI runs ci-node-generate automatically before this
$(MOCKERY) --dir pkg/service/v0 --case underscore --name GatewayClient
$(MOCKERY) --dir pkg/service/v0 --case underscore --name HTTPClient
$(MOCKERY) --dir pkg/service/v0 --case underscore --name Publisher
$(MOCKERY) --srcpkg github.com/go-ldap/ldap/v3 --case underscore --filename ldapclient.go --name Client


.PHONY: ci-node-generate
Expand Down
30 changes: 30 additions & 0 deletions extensions/graph/mocks/gateway_client.go

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

294 changes: 294 additions & 0 deletions extensions/graph/mocks/ldapclient.go

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

4 changes: 3 additions & 1 deletion extensions/graph/pkg/service/v0/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import (
"google.golang.org/grpc"
)

//go:generate make generate
//go:generate make -C ../../.. generate

// GatewayClient is the subset of the gateway.GatewayAPIClient that is being used to interact with the gateway
type GatewayClient interface {
//gateway.GatewayAPIClient

// Authenticates a user.
Authenticate(ctx context.Context, in *gateway.AuthenticateRequest, opts ...grpc.CallOption) (*gateway.AuthenticateResponse, error)
// Returns the home path for the given authenticated user.
// When a user has access to multiple storage providers, one of them is the home.
GetHome(ctx context.Context, in *provider.GetHomeRequest, opts ...grpc.CallOption) (*provider.GetHomeResponse, error)
Expand Down
5 changes: 5 additions & 0 deletions extensions/graph/pkg/service/v0/instrument.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ func (i instrument) PatchUser(w http.ResponseWriter, r *http.Request) {
i.next.PatchUser(w, r)
}

// ChangeOwnPassword implements the Service interface.
func (i instrument) ChangeOwnPassword(w http.ResponseWriter, r *http.Request) {
i.next.ChangeOwnPassword(w, r)
}

// GetGroups implements the Service interface.
func (i instrument) GetGroups(w http.ResponseWriter, r *http.Request) {
i.next.GetGroups(w, r)
Expand Down
5 changes: 5 additions & 0 deletions extensions/graph/pkg/service/v0/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ func (l logging) PatchUser(w http.ResponseWriter, r *http.Request) {
l.next.PatchUser(w, r)
}

// ChangeOwnPassword implements the Service interface.
func (l logging) ChangeOwnPassword(w http.ResponseWriter, r *http.Request) {
l.next.ChangeOwnPassword(w, r)
}

// GetGroups implements the Service interface.
func (l logging) GetGroups(w http.ResponseWriter, r *http.Request) {
l.next.GetGroups(w, r)
Expand Down
Loading

0 comments on commit 86af09b

Please sign in to comment.