Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forget password cleanup #6604

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,6 @@ components:
properties:
invite_user:
type: boolean
forgot_password:
type: boolean

UserList:
type: object
Expand Down
3 changes: 0 additions & 3 deletions clients/java/api/openapi.yaml

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

1 change: 0 additions & 1 deletion clients/java/docs/AuthCapabilities.md

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

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

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

1 change: 0 additions & 1 deletion clients/python/docs/AuthCapabilities.md

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

4 changes: 0 additions & 4 deletions clients/python/lakefs_client/model/auth_capabilities.py

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

6 changes: 0 additions & 6 deletions cmd/lakefs/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,11 @@ var runCmd = &cobra.Command{
logger.WithError(err).Fatal("Unsupported auth mode")
}
if cfg.IsAuthTypeAPI() {
var apiEmailer *email.Emailer
if !cfg.Auth.API.SupportsInvites {
// invites not supported by API - delegate it to emailer
apiEmailer = emailer
}
authService, err = auth.NewAPIAuthService(
cfg.Auth.API.Endpoint,
cfg.Auth.API.Token.SecureValue(),
crypt.NewSecretStore([]byte(cfg.Auth.Encrypt.SecretKey)),
authparams.ServiceCache(cfg.Auth.Cache),
apiEmailer,
logger.WithField("service", "auth_api"),
)
if err != nil {
Expand Down
7 changes: 2 additions & 5 deletions docs/assets/js/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,6 @@ components:
description: Unix Epoch in seconds
friendly_name:
type: string
email:
type: string

CurrentUser:
type: object
Expand All @@ -709,7 +707,6 @@ components:
user:
$ref: "#/components/schemas/User"


UserCreation:
type: object
properties:
Expand Down Expand Up @@ -814,6 +811,7 @@ components:
- featureUpdates
- securityUpdates


Credentials:
type: object
required:
Expand Down Expand Up @@ -887,8 +885,6 @@ components:
properties:
invite_user:
type: boolean
forgot_password:
type: boolean

UserList:
type: object
Expand Down Expand Up @@ -1565,6 +1561,7 @@ paths:
$ref: "#/components/responses/ServerError"



/auth/capabilities:
get:
tags:
Expand Down
4 changes: 1 addition & 3 deletions pkg/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,8 @@ func (c *Controller) PrepareGarbageCollectionUncommitted(w http.ResponseWriter,

func (c *Controller) GetAuthCapabilities(w http.ResponseWriter, r *http.Request) {
inviteSupported := c.Auth.IsInviteSupported()
emailSupported := c.Emailer.Params.SMTPHost != ""
writeResponse(w, r, http.StatusOK, apigen.AuthCapabilities{
InviteUser: &inviteSupported,
ForgotPassword: &emailSupported,
InviteUser: &inviteSupported,
})
}

Expand Down
5 changes: 1 addition & 4 deletions pkg/auth/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ func (a *APIAuthService) ClaimTokenIDOnce(ctx context.Context, tokenID string, e
return a.validateResponse(res, http.StatusCreated)
}

func NewAPIAuthService(apiEndpoint, token string, secretStore crypt.SecretStore, cacheConf params.ServiceCache, emailer *email.Emailer, logger logging.Logger) (*APIAuthService, error) {
func NewAPIAuthService(apiEndpoint, token string, secretStore crypt.SecretStore, cacheConf params.ServiceCache, logger logging.Logger) (*APIAuthService, error) {
if token == "" {
// when no token is provided, generate one.
// communicate with auth service always uses a token
Expand Down Expand Up @@ -1917,9 +1917,6 @@ func NewAPIAuthService(apiEndpoint, token string, secretStore crypt.SecretStore,
logger: logger,
cache: cache,
}
if emailer != nil {
res.delegatedInviteHandler = NewEmailInviteHandler(res, logging.ContextUnavailable(), emailer)
}
return res, nil
}

Expand Down
4 changes: 0 additions & 4 deletions webui/src/pages/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ interface LoginConfig {
const LoginForm = ({loginConfig}: {loginConfig: LoginConfig}) => {
const router = useRouter();
const [loginError, setLoginError] = useState(null);
const { response, error, loading } = useAPI(() => auth.getAuthCapabilities());
if (loading) {
return null;
}

const usernamePlaceholder = "Access Key ID"
const passwordPlaceholder = "Secret Access Key"
Expand Down