diff --git a/internal/brokers/examplebroker.go b/internal/brokers/examplebroker.go index 06f63387b..812165275 100644 --- a/internal/brokers/examplebroker.go +++ b/internal/brokers/examplebroker.go @@ -316,10 +316,10 @@ func (b *exampleBroker) IsAuthorized(ctx context.Context, sessionID, authenticat b.userLastSelectedMode[sessionInfo.username] = sessionInfo.selectedMode b.userLastSelectedModeMu.Unlock() - return access, infoUser, nil + return access, infoUser, err } -//nolint:unparam // This function needs to respect the Brokerer interface, even though it can not error out. +//nolint:unparam // This is an static example implementation, so we don't return an error other than nil. func (b *exampleBroker) handleIsAuthorized(ctx context.Context, sessionInfo sessionInfo, authData map[string]string) (access, infoUser string, err error) { // Note that the "wait" authentication can be cancelled and switch to another mode with a challenge. // Take into account the cancellation. diff --git a/internal/brokers/localbroker.go b/internal/brokers/localbroker.go index 18840c433..ffc5d1a57 100644 --- a/internal/brokers/localbroker.go +++ b/internal/brokers/localbroker.go @@ -5,30 +5,30 @@ import ( "errors" ) -//nolint:unused // Those should never be called +//nolint:unused // We still need localBroker to implement the brokerer interface, even though this type will not be interacted with by the daemon. type localBroker struct { } -//nolint:unused // Those should never be called +//nolint:unused // We still need localBroker to implement the brokerer interface, even though this method should never be called on it. func (b localBroker) GetAuthenticationModes(ctx context.Context, username, lang string, supportedUILayouts []map[string]string) (sessionID, encryptionKey string, authenticationModes []map[string]string, err error) { return "", "", nil, errors.New("GetAuthenticationModes should never be called on local broker") } -//nolint:unused // Those should never be called +//nolint:unused // We still need localBroker to implement the brokerer interface, even though this method should never be called on it. func (b localBroker) SelectAuthenticationMode(ctx context.Context, sessionID, authenticationModeName string) (uiLayoutInfo map[string]string, err error) { return nil, errors.New("SelectAuthenticationMode should never be called on local broker") } -//nolint:unused // Those should never be called +//nolint:unused // We still need localBroker to implement the brokerer interface, even though this method should never be called on it. func (b localBroker) IsAuthorized(ctx context.Context, sessionID, authenticationData string) (access, infoUser string, err error) { return "", "", errors.New("IsAuthorized should never be called on local broker") } -//nolint:unused // Those should never be called +//nolint:unused // We still need localBroker to implement the brokerer interface, even though this method should never be called on it. func (b localBroker) AbortSession(ctx context.Context, sessionID string) (err error) { return errors.New("AbortSession should never be called on local broker") } -//nolint:unused // Those should never be called +//nolint:unused // We still need localBroker to implement the brokerer interface, even though this method should never be called on it. func (b localBroker) CancelIsAuthorized(ctx context.Context, sessionID string) { }