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

NOISSUE - Refactor single-user mode #1471

Merged
merged 4 commits into from
Oct 11, 2021

Conversation

dborovcanin
Copy link
Collaborator

Signed-off-by: dusanb94 <[email protected]

What does this do?

This pull request refactors single-user mode for Things service.

Which issue(s) does this PR fix/relate to?

There is no such issue.

List any changes that modify/break current functionality

There are no such changes.

Have you included tests for your changes?

Yes.

Did you document any new/modified functionality?

Yes. Docs explaining single-user mode are added.

Notes

N/A

@dborovcanin dborovcanin requested a review from a team as a code owner October 7, 2021 10:46
Signed-off-by: dusanb94 <[email protected]>
@@ -23,7 +23,7 @@ import (
"github.com/mainflux/mainflux/pkg/messaging"
"github.com/mainflux/mainflux/pkg/messaging/nats"
"github.com/mainflux/mainflux/pkg/uuid"
localusers "github.com/mainflux/mainflux/things/users"
localusers "github.com/mainflux/mainflux/things/auth"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only cocncern is should this one be called auth, because again when we take a look at things folder in a couple of months and when we see auth - will we know it is a Single-User Mode related module? I was confused like this with previous naming, which was user.

So just one thing to conside - should it be something like singleuser (or something like this, self-documenting), or we leave auth (I am fine with auth also, just challenging the solution a bit).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually spent some time thinking about the naming and I decided to go with auth and single_user for go files. The reason is that this is implementation of auth for single_user. It is not ideal, but I find it a bit less confusing than users. Also, standalone sounds a bit better to me than single_user, but I did not want to rename env vars to provide backward compatibility. @drasko What do you think about that auth and standalone?

@@ -101,6 +101,10 @@ $GOBIN/mainflux-things

Setting `MF_THINGS_CA_CERTS` expects a file in PEM format of trusted CAs. This will enable TLS against the Users gRPC endpoint trusting only those CAs that are provided.

In constrained environments, sometimes it makes sense to run Things service as a standalone to reduce network traffic and simplify deployment. This means that Things service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a more detailed documentation in the mainflux/docs repo is needed, with detailed explication how this single-user mode is deployed (Dockerfile) and used.

I.e. - there should be a dedicated chapter (or subsection in Authorization) for Single-User Mode, so that people see and understand that this feature exists (otherwise, it is unnoticed).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but one paragraph is sufficient for this, since you just set the environment variables and one example how things api is used then, additionally advise to remove auth service from compose when using this mode

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @mteodor, I'd say this is good enough for service README. I'll add suggestion for removing auth from compose and we can add more details in a separate section in docs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed single-user to standalone, please review.

@dborovcanin dborovcanin force-pushed the single-user-docs branch 2 times, most recently from a3c1b1a to 42ca807 Compare October 11, 2021 10:48
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-commenter
Copy link

Codecov Report

Merging #1471 (42ca807) into master (66d3da0) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1471   +/-   ##
=======================================
  Coverage   70.92%   70.92%           
=======================================
  Files         123      123           
  Lines        9565     9565           
=======================================
  Hits         6784     6784           
  Misses       2254     2254           
  Partials      527      527           
Impacted Files Coverage Δ
things/standalone/standalone.go 72.72% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66d3da0...42ca807. Read the comment docs.

@drasko drasko merged commit 39ae7bd into absmach:master Oct 11, 2021
buraksekili pushed a commit to buraksekili/mainflux that referenced this pull request Oct 18, 2021
* Refactor single user mode

Signed-off-by: dusanb94 <[email protected]>

* Fix Twins dependency

Signed-off-by: dusanb94 <[email protected]>

* Rename `single-user` to `standalone`

Signed-off-by: dusanb94 <[email protected]>

Co-authored-by: Drasko DRASKOVIC <[email protected]>
buraksekili pushed a commit to buraksekili/mainflux that referenced this pull request Oct 18, 2021
* Refactor single user mode

Signed-off-by: dusanb94 <[email protected]>

* Fix Twins dependency

Signed-off-by: dusanb94 <[email protected]>

* Rename `single-user` to `standalone`

Signed-off-by: dusanb94 <[email protected]>

Co-authored-by: Drasko DRASKOVIC <[email protected]>
dborovcanin added a commit to dborovcanin/supermq that referenced this pull request Oct 22, 2021
* Refactor single user mode

Signed-off-by: dusanb94 <[email protected]>

* Fix Twins dependency

Signed-off-by: dusanb94 <[email protected]>

* Rename `single-user` to `standalone`

Signed-off-by: dusanb94 <[email protected]>

Co-authored-by: Drasko DRASKOVIC <[email protected]>
mteodor pushed a commit to mteodor/mainflux that referenced this pull request Dec 23, 2021
* Refactor single user mode

Signed-off-by: dusanb94 <[email protected]>

* Fix Twins dependency

Signed-off-by: dusanb94 <[email protected]>

* Rename `single-user` to `standalone`

Signed-off-by: dusanb94 <[email protected]>

Co-authored-by: Drasko DRASKOVIC <[email protected]>
@dborovcanin dborovcanin deleted the single-user-docs branch June 13, 2022 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants