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

Rebase with Magistrala Repo #1950

Merged
merged 104 commits into from
Jan 8, 2024
Merged

Conversation

arvindh123
Copy link
Contributor

Pull request title should be MF-XXX - description or NOISSUE - description where XXX is ID of issue that this PR relate to.
Please review the CONTRIBUTING.md file for detailed contributing guidelines.

What does this do?

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

Put here Resolves #XXX to auto-close the issue that your PR fixes (if such)

List any changes that modify/break current functionality

Have you included tests for your changes?

Did you document any new/modified functionality?

Notes

dborovcanin and others added 30 commits October 26, 2023 12:50
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
…h#15)

* fix renaming of mainflux-server

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* generate certs

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 24.0.6+incompatible to 24.0.7+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v24.0.6...v24.0.7)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/nats-io/nkeys](https://github.com/nats-io/nkeys) from 0.4.5 to 0.4.6.
- [Release notes](https://github.com/nats-io/nkeys/releases)
- [Changelog](https://github.com/nats-io/nkeys/blob/main/.goreleaser.yml)
- [Commits](nats-io/nkeys@v0.4.5...v0.4.6)

---
updated-dependencies:
- dependency-name: github.com/nats-io/nkeys
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
Co-authored-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
* Fix Auth gRPC server name

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

* Rename import aliases

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

* Rename issuer name to Magistrala

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

---------

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
Co-authored-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
The DOCKER_PROJECT variable was not being assigned correctly due to a missing closing parenthesis in the command. This has been fixed by adding the missing parenthesis.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* add permission to query sdk

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* revert subject object action

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
…ang.org/grpc/otelgrpc (absmach#38)

Bumps [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.45.0 to 0.46.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go-contrib@zpages/v0.45.0...zpages/v0.46.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix branch name in Semaphore

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

* Update README badge

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

* Update golangci lint version

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

---------

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
Co-authored-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
When depandabot updated one of the opentelemetry dependenices
it did not update others hence the change was breaking jaeger
trace provider. This commit updates the remaining dependecies
while removing unnecessary import alias
* feat(auth): Add invitationkey

Add InvitationKey to auth key types and set expiration duration

* feat(auth): Add support for InvitationKey in Identify function

This commit adds support for the InvitationKey type in the Identify function of the auth service. Now, when the key type is either RecoveryKey, AccessKey, or InvitationKey, the key's subject will be returned. This allows for identifying users with an invitation key.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
* refactor(env): Remove internal env package

- update env package to v10
- fix jaeger not sending traces
- added jaeger URL as url.URL rather than string value
- made changes to jaeger provider

* feat(auth): Modify env variables in .env file

Update the AccessDuration variable in main.go to reflect the desired token duration for authentication.
Additionally, modify various environment variables in the .env file related to the auth module.
These changes include updating configuration settings for auth and datastore services, such as token duration, logging level, database details, and server settings.
These modifications are necessary for proper functionality and are intended for use in a Docker Compose file.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* fix(docker): fix incorrect variable name in docker-compose.yml

Fixed an issue where the variable name for the PostgreSQL database was incorrect in the docker-compose.yml file. Updated the variable name from "MG_AUTH_DB" to "MG_AUTH_DB_NAME" to properly set the name of the database.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
…per admin in add policies (absmach#57)

* fix: super admin to create entites in domain

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove policy agent from not required function

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
* feat(auth): Export auth setup

Since auth is used by other external packages it is wise to export the package of how to connect to auth service so that other packages can be able to use it rather than to rewrite the code
Added envPrefix as a parameter as the user should be able to specify their own ev prefix

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat: Add auth configuration loading and setup

This commit adds auth configuration loading and setup to the main.go files in different commands. The modifications include setting up authentication and authorization for various services, connecting to servers, and setting up authentication clients and handlers. Changes are made to the main function and other functions in different packages to set up auth clients and parse configuration options.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* add: domains sdk

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: cli users token and refresh

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: cli provision

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add domains cli

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove test program

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update cli command for list domains

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add list user domain cli cmd

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix varaible naming

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: comments grammar & varabile; add package headers

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
* chore(license): update copyright notices

Add CI check for non go files to check that the files contain a license

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* fix(ci): log failed files

When the CI fails during check for license header, log the failed file to console so that someone can check on the actual file. Also simplify the grep check to make it more human readable and understandable

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
The test case was returning a wrapped error yet it was
supposed to return a single error. The wrapped error
was just a duplicate.
Fix bug in loading auth config and also refactor postgres connect
* style: fix linting errors

Fix code formatting and remove unnecessary
comments

* chore: Exclude string occurrences

Excluded the occurrences of the strings "Usage:" and "For example:" from being marked as issues in the golangci.yml file.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Fix tests in certs package
Fix failing tests on `pkg/clients` tests
Fix tests in consumers package by syncing with the new auth scheme
* Fix Bootstrap Tests

Fix failing tests in bootstrap package

* fix(domains): align tests with domains
rodneyosodo and others added 27 commits December 7, 2023 13:56
* refactor(clients): deprecate RetrieveNames

Remove RetrieveNames and modify RetrieveAllBasicInfo to replace it. Remove sensitive information when retrieving basic information

* change from if statement to switch

Co-authored-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

---------

Co-authored-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
* feat(invitations): Implement invitations outline

This commit adds the necessary data structures and methods for managing invitations to join a domain. It includes structs for invitations, pages of invitations, and pages of invitations with additional metadata. Additionally, error variables for missing and invalid relations are defined.
The commit also introduces methods for sending, viewing, listing, accepting, and deleting invitations. In addition, it includes functions for creating, retrieving, updating, and deleting invitations in a repository.
Furthermore, a function is added to check the validity of a relation, returning an error if it does not match specific values.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* docs(invitations): add godocs

* test: Add tests for MarshalJSON and CheckRelation

Add tests to ensure the MarshalJSON function of the InvitationPage struct correctly marshals the JSON representation. Also, add tests for the CheckRelation function to verify its behavior in different scenarios. The tests use a loop and the assert.Equal function to compare expected and actual errors.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(invitations): add withToken parameter to RetrieveAll method

This commit adds a new parameter "withToken" to the RetrieveAll method in the invitations package. This parameter allows the caller to specify whether they want to include the token in the returned invitation list.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* docs(invitations): Add Base README

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* fix: remove vendor from go test

Signed-off-by: Musilah <nataleigh.nk@gmail.co>

* fix: update make test

Signed-off-by: Musilah <nataleigh.nk@gmail.co>

* fix: fix coverage.txt in cd.yml

Signed-off-by: Musilah <nataleigh.nk@gmail.co>

* fix: simplify go test

Signed-off-by: Musilah <nataleigh.nk@gmail.co>

* fix: remove cassandra

Signed-off-by: Musilah <nataleigh.nk@gmail.co>

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
* feat(invitations): add repository layer

Add PostgreSQL migration, setup test, and
repository for invitations

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(invitations): Implement error handling and repository functions

This commit introduces modifications to the error handling and repository functions in the internal/postgres and invitations/postgres packages. The changes primarily focus on retrieving invitations from a database and handling errors appropriately. Additionally, the code diff includes updates to imports and test cases for the InvitationCreate function. The Retrieve function is thoroughly tested with different scenarios, including tests for updating invitation tokens and confirmations. Moreover, tests are added for the update and delete functions for invitations in a repository.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat: test with token

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(Page): Add new field `InvitedByOrUserID`

This code change adds a new field to the Page struct and modifies the pageQuery function to handle it. The change also includes modifications to the test file. The code snippet tests the functionality of retrieving invitations, specifically using the invited_by_or_user_id field. The test ensures that the retrieved invitations match the expected response.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(invitations): add updated_at field to UpdateConfirmation query

This commit adds the updated_at field to the UpdateConfirmation query in the invitations package. This ensures that the updated_at field is updated when confirming an invitation.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* feat(invitation): Add new function for sending invitations

This commit adds a new function for sending invitations in the invitation management and authorization code. The function allows users to send invitations to other users, providing necessary details such as email address and invitation message. This feature enhances the overall functionality of the application.

The code changes include the addition of the "sendInvitation" function in the invitation module, along with necessary validation checks and error handling. Additionally, test cases have been added to cover different scenarios and ensure the proper functioning of the feature.

This commit improves the invitation management and authorization functionality by enabling users to send invitations to others.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* test(invitations): Add test cases for invitation functions

Add new test cases to cover different scenarios and expected behavior in the invitation functions. These test cases ensure proper error handling and validate the functionality of the code related to invitations.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat: test with token

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(invitations): update ListInvitations function

This commit updates the ListInvitations function in the invitations service. The changes include updating the page parameters to use InvitedByOrUserID instead of separate InvitedBy and UserID fields. This ensures that invitations are retrieved correctly based on the user ID.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(invitations): Add rename to checkAdmin

An existing function has been renamed to "checkAdmin".

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Refactor RetrieveAll method signature

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* feat(api): Implement endpoints for invitations

Implemented endpoints for sending, viewing, accepting, and deleting invitations in the API. Added validation, error handling, logging, and metrics functionality. Utilized various packages, routers, and frameworks to handle HTTP requests and perform invitation operations. Also included functions for decoding request payloads and implementing tracing functionality.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(invitations): add service mocks

* feat(endpoint): test API layer

"endpoint_test.go" is introduced, which contains test cases for API endpoints. These test functions cover various features related to invitations, including different input parameters and expected outcomes. Furthermore, the code includes modifications to a function in the transport file, where a parameter is removed and a route is modified for better performance and efficiency.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* refactor(invitations): accept invitation to take domain

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* refactor(invitations): rename domain to domainID

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
- Updated the error assertion in the invitations_test.go file.
- Replaced the assert.ErrorIs() function with assert.True() and errors.Contains() to check if the expected error is contained in the actual error.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* add: view domain permissions

Signed-off-by: Arvindh <arvindh91@gmail.com>

* "gofumpt" -ed

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: retrieve group

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change in approch for retrieve domain permissions

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change to query fram approch

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: view domain permissions sdk

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: view domain permissions sdk

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: view domain permissions sdk

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: golangci errors

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
Make sure MTLS support works after the new auth changes
* feat(service): Add new "invitations" service

This commit adds a new service called "invitations" to the existing file. The service includes the necessary imports and initializes components for its functionality. It also includes configuration settings and a Docker Compose file. Additionally, instructions for deploying and using the service are provided, along with a function to create an HTTP handler.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* docs(api): invitation api

The commit adds documentation for an API that allows users to manage invitations. It includes information about the endpoints, parameters, data types, and components used in the API. The documentation also outlines the properties and specifications of the Invitation object. This commit provides a comprehensive overview of the API's functionality and structure.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* fix: accept invitation to take in domain

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* refactor(invitations): rename domain to domainID

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Authorize on id(domain+user) rather than user

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* feat: API layer for search

Implement the API layer for search. This includes the following:
- API endpoints for search
- Logging
- Metrics
- Tracing

* fix(api): fix default order in common.go

The default order in the common.go file was set to "updated_by" instead of "updated_at". This commit fixes the default order to "updated_at" to ensure accurate sorting.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* test: Add test function for search clients

The test function creates a new service with mock dependencies and tests various scenarios, including authorized and invalid tokens. It also checks the response and error values. The test function sets up mock calls and asserts expected values.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* refactor(users): remove search endpoint

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
* Fix pkg tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* fix errors

* refactor groups tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Add opts to docker containers

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Fix pkg tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Remove unvailable publish test

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Remove unvailable publish test

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Cleaning up

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Cleaning up

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
* Refactor invitation to list invitations by state

Add states when fetching invitations that is:
- pending
- accepted
- all
- unknown

The changes focus on refactoring the functions responsible for retrieving and updating invitation data from a PostgreSQL database. Additionally, improvements have been made to the error handling mechanism. The commit also introduces new test cases to verify the functionality of the implemented functions.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Rename `todbInviation` to `toDBInvitation`

This is to align with the rest of the codebase

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Refactor invitation state constants and string conversions

- Refactor the constants for invitation states in the state.go file.
- Rename the "pendingState" constant to "pending" and the "acceptedState" constant to "accepted".
- Update the corresponding String() function to return the new constant names.
- Update the ToState() function to handle the new constant names.

This commit improves the clarity and consistency of the invitation state constants and their string representations.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
* fix(errors): Fix nil pointer error in NewSDKError

In the NewSDKError function, a check is added to handle the case where the input error is nil. Previously, if the error was nil, the function would panic. This fix ensures that the function returns nil instead of panicking when the input error is nil.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(sdk-mock): Add mock functions for SDK testing

This commit adds a set of mock functions for the software development kit (SDK) to facilitate testing. These functions simulate the behavior of the actual functions in the SDK and have defined input parameters and return values. The code also includes error handling logic and checks for different return types.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* test: use sdk mocked interface

* feat(workflow): check for generated files

The commit modifies the check-proto GitHub workflow to check-generated files. It checks for changes in specific paths and verifies the protobuf files and generated mocks. The code also includes checking if the SDK mock is up to date, installing a tool, generating mocks, and displaying an error message if the mocks are different. The tool we use is: https://github.com/vektra/mockery.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(mocks): Add copyright notice to mocks.go

Added a copyright notice to the mocks.go file in the pkg/sdk/go directory for clarity and attribution.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(build): Add target for generating mocks

Added a new target to the Makefile for generating mocks using the mockery tool. The target checks if the mockery tool is installed and then runs the "go generate" command to generate mocks for the codebase..

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Improve error messages in check-generated-files.yml

In this commit, I have made changes to the check-generated-files.yml file. Specifically, I have updated the error messages to provide more information about the issue. Instead of simply stating that the proto file and generated Go file are out of sync, the error message now includes a more detailed explanation and a suggestion for resolving the issue. Additionally, I have also added error messages for the generated mocks for the SDK. These error messages provide information about the sync issue and suggest running the necessary commands to resolve it. This commit aims to improve the clarity of error messages and help developers quickly identify and fix sync issues in the codebase.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
* add: grpc error handling

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: golangci errors & remove: switch case placeholders

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Handle ok case error

* Handle ok case error

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix(e2e): Add admin role and permission

This commit adds a new constant and modifies the `createUser` function. The function now creates a user with an admin role and a domain with admin permissions.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* chore(ci): add e2e testing on CI

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Remove unnecessary time.Sleep calls and optimize code execution

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* fix: update badges

Signed-off-by: Musilah <nataleigh.nk@gmail.com>

* fix: update badges files

Signed-off-by: Musilah <nataleigh.nk@gmail.com>

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.com>
- repoerr "github.com/absmach/magistrala/pkg/errors/repository" instead of repoerror
- svcerr "github.com/absmach/magistrala/pkg/errors/service" instead of svcerror

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
* Generate users repository mocks

Add generation of users repository mocks for easier testing purposes
rather than writing the mocks

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Change output dir for generated mocks

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* Refactor codegen to include pubsub

The commit includes changes to files related to messaging using the PubSub pattern.
It introduces a new step for checking PubSub updates and generating mocks.
Additionally, a new file for autogenerated mock code has been added.
Function and test case modifications have been made, including the use of mock implementations and checking for expected errors.
The commit also defines a mock implementation of a publisher-subscriber system using websockets.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Add error check for authentication

modify error handling, and return 401 status code in updateClientSecret function

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Change output dir for generated mocks

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* add compose file for ui

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* fix bootstrap url

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* update image source to use docker hub

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
* Fix auth tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Fix auth tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Fix auth tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Fix service tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Fix auth tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Fix auth tests

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Fix auth errors

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* rafactor set up

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
@arvindh123 arvindh123 changed the title Rebase Magistrala to Mainflux Rebase with Magistrala Repo Dec 17, 2023
@dborovcanin dborovcanin merged commit 48e9711 into absmach:master Jan 8, 2024
@arvindh123 arvindh123 deleted the sync_magistrala branch January 9, 2024 07:01
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.

7 participants