mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-23 20:03:15 +00:00
fix: add requests
This commit is contained in:
18
pkg/auth/api/grpc/application.go
Normal file
18
pkg/auth/api/grpc/application.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
)
|
||||
|
||||
func (s *Server) GetApplicationByID(ctx context.Context, request *ApplicationID) (*Application, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-Rfh8e", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) SearchApplications(ctx context.Context, appSearch *ApplicationSearchRequest) (*ApplicationSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-ju8Rd", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) AuthorizeApplication(ctx context.Context, auth *ApplicationAuthorizeRequest) (*Application, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-lo8ws", "Not implemented")
|
||||
}
|
34
pkg/auth/api/grpc/auth_session.go
Normal file
34
pkg/auth/api/grpc/auth_session.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
)
|
||||
|
||||
func (s *Server) CreateAuthSession(ctx context.Context, request *AuthSessionCreation) (_ *AuthSessionResponse, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dh3Rt", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetAuthSession(ctx context.Context, id *AuthSessionID) (_ *AuthSessionResponse, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dk56g", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) SelectUser(ctx context.Context, request *SelectUserRequest) (_ *AuthSessionResponse, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dl5gs", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) VerifyUser(ctx context.Context, request *VerifyUserRequest) (_ *AuthSessionResponse, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-39dGs", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) VerifyPassword(ctx context.Context, password *VerifyPasswordRequest) (_ *AuthSessionResponse, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-tu9j2", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) VerifyMfa(ctx context.Context, mfa *VerifyMfaRequest) (_ *AuthSessionResponse, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-oi9GB", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetAuthSessionByTokenID(ctx context.Context, id *TokenID) (_ *AuthSessionView, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dk56z", "Not implemented")
|
||||
}
|
19
pkg/auth/api/grpc/grant.go
Normal file
19
pkg/auth/api/grpc/grant.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
)
|
||||
|
||||
func (s *Server) SearchGrant(ctx context.Context, grantSearch *GrantSearchRequest) (*GrantSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-mcn5z", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) SearchMyProjectOrgs(ctx context.Context, request *MyProjectOrgSearchRequest) (*MyProjectOrgSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-8kdRf", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) IsIamAdmin(ctx context.Context, _ *empty.Empty) (*IsAdminResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-9odFv", "Not implemented")
|
||||
}
|
50
pkg/auth/api/grpc/permissions.go
Normal file
50
pkg/auth/api/grpc/permissions.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
)
|
||||
|
||||
func (s *Server) GetMyZitadelPermissions(ctx context.Context, _ *empty.Empty) (*MyPermissions, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-or67G", "Not implemented")
|
||||
//ctxData := auth.GetCtxData(ctx)
|
||||
//
|
||||
//grants, err := s.processor.ResolveGrants(ctx, ctxData.UserID, ctxData.OrgID)
|
||||
//if err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
//
|
||||
//permissions := &MyPermissions{Permissions: []string{}}
|
||||
//
|
||||
//for _, grant := range grants {
|
||||
// for _, role := range grant.Roles {
|
||||
// roleName, ctxID := auth.SplitPermission(role)
|
||||
// for _, mapping := range s.authConf.RolePermissionMappings {
|
||||
// if mapping.Role == roleName {
|
||||
// permissions.appendPermissions(ctxID, mapping.Permissions...)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//return permissions, nil
|
||||
}
|
||||
|
||||
func (p *MyPermissions) appendPermissions(ctxID string, permissions ...string) {
|
||||
for _, permission := range permissions {
|
||||
p.appendPermission(ctxID, permission)
|
||||
}
|
||||
}
|
||||
|
||||
func (p *MyPermissions) appendPermission(ctxID, permission string) {
|
||||
if ctxID != "" {
|
||||
permission = permission + ":" + ctxID
|
||||
}
|
||||
for _, existingPermission := range p.Permissions {
|
||||
if existingPermission == permission {
|
||||
return
|
||||
}
|
||||
}
|
||||
p.Permissions = append(p.Permissions, permission)
|
||||
}
|
20
pkg/auth/api/grpc/probes.go
Normal file
20
pkg/auth/api/grpc/probes.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
pb_struct "github.com/golang/protobuf/ptypes/struct"
|
||||
)
|
||||
|
||||
func (s *Server) Healthz(_ context.Context, e *empty.Empty) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-bst5W", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) Ready(ctx context.Context, e *empty.Empty) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-or0vW", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) Validate(ctx context.Context, _ *empty.Empty) (*pb_struct.Struct, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-lo6Eg", "Not implemented")
|
||||
}
|
34
pkg/auth/api/grpc/server.go
Normal file
34
pkg/auth/api/grpc/server.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
var _ AuthServiceServer = (*Server)(nil)
|
||||
|
||||
type Config struct {
|
||||
Port string
|
||||
SearchLimit int
|
||||
}
|
||||
|
||||
type Server struct {
|
||||
port string
|
||||
searchLimit int
|
||||
}
|
||||
|
||||
func StartServer(conf Config) *Server {
|
||||
return &Server{
|
||||
port: conf.Port,
|
||||
searchLimit: conf.SearchLimit,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) GRPCPort() string {
|
||||
return s.port
|
||||
}
|
||||
|
||||
func (s *Server) GRPCServer() (*grpc.Server, error) {
|
||||
gs := grpc.NewServer()
|
||||
RegisterAuthServiceServer(gs, s)
|
||||
return gs, nil
|
||||
}
|
10
pkg/auth/api/grpc/token.go
Normal file
10
pkg/auth/api/grpc/token.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
)
|
||||
|
||||
func (s *Server) CreateToken(ctx context.Context, request *CreateTokenRequest) (_ *Token, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-86dG3", "Not implemented")
|
||||
}
|
122
pkg/auth/api/grpc/user.go
Normal file
122
pkg/auth/api/grpc/user.go
Normal file
@@ -0,0 +1,122 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
)
|
||||
|
||||
func (s *Server) GetUserByID(ctx context.Context, request *UserID) (*User, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-fj74G", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) IsUserUnique(ctx context.Context, request *UniqueUserRequest) (*UniqueUserResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dke9f", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetMyUserProfile(ctx context.Context, _ *empty.Empty) (*UserProfile, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-fis93", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetMyUserEmail(ctx context.Context, _ *empty.Empty) (*UserEmail, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-93j5d", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetMyUserPhone(ctx context.Context, _ *empty.Empty) (*UserPhone, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-Hj75G", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetMyUserAddress(ctx context.Context, _ *empty.Empty) (*UserAddress, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-21jd4", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetMyMfas(ctx context.Context, _ *empty.Empty) (*MultiFactors, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-vkl9i", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) RegisterUser(ctx context.Context, request *RegisterUserRequest) (*User, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-03idx", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) RegisterUserWithExternal(ctx context.Context, request *RegisterUserExternalIDPRequest) (*User, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dlwpd", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) UpdateMyUserProfile(ctx context.Context, request *UpdateUserProfileRequest) (*UserProfile, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dlep3", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) ChangeMyUserEmail(ctx context.Context, request *UpdateUserEmailRequest) (*UserEmail, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-lme45", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) VerifyMyUserEmail(ctx context.Context, request *VerifyMyUserEmailRequest) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-poru7", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) VerifyUserEmail(ctx context.Context, request *VerifyUserEmailRequest) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dlep3", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) ResendMyEmailVerificationMail(ctx context.Context, _ *empty.Empty) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dh69i", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) ResendEmailVerificationMail(ctx context.Context, id *UserID) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-mAq23", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) ChangeMyUserPhone(ctx context.Context, request *UpdateUserPhoneRequest) (*UserPhone, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dk45g", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) VerifyMyUserPhone(ctx context.Context, request *VerifyUserPhoneRequest) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-ol6gE", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) ResendMyPhoneVerificationCode(ctx context.Context, _ *empty.Empty) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-Wk8rf", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) UpdateMyUserAddress(ctx context.Context, request *UpdateUserAddressRequest) (*UserAddress, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-cmt7F", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) SetMyPassword(ctx context.Context, request *PasswordRequest) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-pl9c2", "Not implemented")
|
||||
}
|
||||
func (s *Server) RequestPasswordReset(ctx context.Context, request *ResetPasswordRequest) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-xm5hW", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) PasswordReset(ctx context.Context, request *ResetPassword) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-mce5W", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) ChangeMyPassword(ctx context.Context, request *PasswordChange) (*empty.Empty, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dlo6G", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) AddMfaOTP(ctx context.Context, _ *empty.Empty) (_ *MfaOtpResponse, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-al35G", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) VerifyMfaOTP(ctx context.Context, request *VerifyMfaOtp) (_ *MfaOtpResponse, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-kgjZ7", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) RemoveMfaOTP(ctx context.Context, _ *empty.Empty) (_ *empty.Empty, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-9k46d", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) SkipMfaInit(ctx context.Context, request *SkipMfaInitRequest) (_ *empty.Empty, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dl3i5", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) VerifyUserInit(ctx context.Context, request *VerifyUserInitRequest) (_ *empty.Empty, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-itk6h", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) ResendUserInitMail(ctx context.Context, request *UserID) (_ *empty.Empty, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-dk467", "Not implemented")
|
||||
}
|
18
pkg/auth/api/grpc/user_agent.go
Normal file
18
pkg/auth/api/grpc/user_agent.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
)
|
||||
|
||||
func (s *Server) GetUserAgent(ctx context.Context, request *UserAgentID) (_ *UserAgent, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-iu7jF", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) CreateUserAgent(ctx context.Context, request *UserAgentCreation) (_ *UserAgent, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-sdfk3", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) RevokeUserAgent(ctx context.Context, id *UserAgentID) (_ *UserAgent, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-09HjK", "Not implemented")
|
||||
}
|
23
pkg/auth/api/grpc/user_session.go
Normal file
23
pkg/auth/api/grpc/user_session.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
)
|
||||
|
||||
func (s *Server) GetUserAgentSessions(ctx context.Context, id *UserAgentID) (_ *UserSessions, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-ue45f", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetUserSession(ctx context.Context, id *UserSessionID) (_ *UserSession, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-lor5h", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) TerminateUserSession(ctx context.Context, id *UserSessionID) (_ *empty.Empty, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-bnmt6", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) GetMyUserSessions(ctx context.Context, _ *empty.Empty) (_ *UserSessionViews, err error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-nc52s", "Not implemented")
|
||||
}
|
Reference in New Issue
Block a user