Improve error handling and SDK error testing. The code now includes signal handling, error wrapping, checking for contained errors, and testing HTTP error responses. Additionally, assertions have been added to ensure the expected behavior is met.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* 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>
This commit adds various configurations and environment variables for different services in the codebase. These services include CoAP adapter, HTTP adapter, LoRa adapter, MQTT adapter, OPC-UA adapter, and WebSocket adapter.
The variables control settings such as log level, host and port, server certificates and keys, auth URLs, message broker URLs, Jaeger server URLs, telemetry settings, and instance IDs.
Additionally, instructions are provided for running the services outside of the Docker container. TLS encryption can be enabled by setting specific variables and providing PEM format files for certificates and keys. Default values are also provided for unset variables.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
The commit introduces changes to the "auth/README.md" file. It updates the authentication keys, adds new key types, and introduces the concept of domains.
The documentation also includes information on the configuration settings for the authentication service, such as database and server details. It mentions that the service is distributed as a Docker container and provides instructions for running it outside of the container.
Furthermore, the commit mentions a configuration file for the "magistrala-auth" service and highlights specific changes made to environment variables in various files.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
The commit modifies the configuration files and Docker Compose files related to the "certs" service. The changes include updating URLs, adjusting the log level, and modifying the SDK certs URL. This refactor ensures that the service operates with the correct settings and improves the overall functionality.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Updated the documentation to include details about the configuration variables and environment settings for the bootstrap service. This includes information about database connections, SSL settings, authentication services, event sources, and other parameters. Also added deployment instructions and links to API documentation for further information.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Refactor initialization of SpiceDB client and schema to take in context
Update Docker environment variables and Docker Compose file
Update the Docker environment variables and the Docker Compose file to reflect the latest configuration requirements. This ensures that the application can run smoothly in the Docker environment.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* feat(auth): Add invitation key generation
This commit adds the functionality to generate an invitation key in the auth service. The `invitationKey` function is responsible for generating the key and issuing an access token. It sets the key type, expiration time, and subject based on the user's domain. The generated access token is returned as part of the response.
The `invitationKey` function is called in the `Issue` function when the key type is InvitationKey. This allows for the generation of invitation keys when needed.
This feature enhances the functionality of the auth service by enabling the generation of invitation keys for user invitations.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* fix(auth): fix invitation duration
The invitation duration in the auth service has been corrected to 7 days (7 * 24 * time.Hour) instead of 24 hours.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
* feat(auth): configure invitation duration by env vars
Configure invitation duration by envionment variables. The default is `168h` which is 1 week.
---------
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>