MSP-8520 rename sudir to oauth
This commit is contained in:
1 parent
c32459f73d
commit
5bd389757c
23 files changed
+254
-252
No files matched your search
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type UiSettingsService interface {
|
||||
SudirSettings(ctx context.Context, req domain.ClientNameRequest) (*domain.UiSudirSetting, error)
|
||||
OauthSettings(ctx context.Context, req domain.ClientNameRequest) (*domain.UiOauthSetting, error)
|
||||
}
|
||||
|
||||
type UiSettings struct {
|
||||
@@ -23,20 +23,20 @@ func NewUiSettings(service UiSettingsService) UiSettings {
|
||||
}
|
||||
}
|
||||
|
||||
// UiSudirSettings
|
||||
// UiOauthSettings
|
||||
// @Tags ui_settings
|
||||
// @Summary Получение настроек для ui для авторизации через СУДИР
|
||||
// @Description Получение настроек для ui для авторизации через СУДИР
|
||||
// @Summary Получение настроек для ui для авторизации через OAuth
|
||||
// @Description Получение настроек для ui для авторизации через OAuth
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ClientNameRequest true "Тело запроса"
|
||||
// @Success 200 {object} domain.UiSudirSetting
|
||||
// @Success 200 {object} domain.UiOauthSetting
|
||||
// @Failure 400 {object} domain.GrpcError
|
||||
// @Failure 401 {object} domain.GrpcError "Неизвестное название клиента"
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /ui_settings/sudir [POST]
|
||||
func (c UiSettings) SudirSettings(ctx context.Context, req domain.ClientNameRequest) (*domain.UiSudirSetting, error) {
|
||||
resp, err := c.service.SudirSettings(ctx, req)
|
||||
// @Router /ui_settings/oauth [POST]
|
||||
func (c UiSettings) OauthSettings(ctx context.Context, req domain.ClientNameRequest) (*domain.UiOauthSetting, error) {
|
||||
resp, err := c.service.OauthSettings(ctx, req)
|
||||
switch {
|
||||
case errors.Is(err, domain.ErrUnknownClient):
|
||||
return nil, status.Error(codes.Unauthenticated, "invalid client name")
|
||||
|
||||
Reference in new issue
Block a user