2021-02-22 11:27:47 +00:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2022-04-12 14:20:17 +00:00
|
|
|
"strings"
|
2021-10-26 09:33:59 +00:00
|
|
|
|
2022-04-26 23:01:45 +00:00
|
|
|
"github.com/zitadel/logging"
|
2021-10-26 09:33:59 +00:00
|
|
|
|
2022-04-26 23:01:45 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/command/preparation"
|
|
|
|
"github.com/zitadel/zitadel/internal/crypto"
|
|
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
|
|
"github.com/zitadel/zitadel/internal/errors"
|
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
|
|
project_repo "github.com/zitadel/zitadel/internal/repository/project"
|
|
|
|
"github.com/zitadel/zitadel/internal/telemetry/tracing"
|
2021-02-22 11:27:47 +00:00
|
|
|
)
|
|
|
|
|
2022-04-12 14:20:17 +00:00
|
|
|
type addAPIApp struct {
|
|
|
|
AddApp
|
|
|
|
AuthMethodType domain.APIAuthMethodType
|
|
|
|
|
|
|
|
ClientID string
|
|
|
|
ClientSecret *crypto.CryptoValue
|
|
|
|
ClientSecretPlain string
|
|
|
|
}
|
|
|
|
|
feat: Configurable Unique Machine Identification (#3626)
* feat: Configurable Unique Machine Identification
This change fixes Segfault on AWS App Runner with v2 #3625
The change introduces two new dependencies:
* github.com/drone/envsubst for supporting AWS ECS, which has its metadata endpoint described by an environment variable
* github.com/jarcoal/jpath so that only relevant data from a metadata response is used to identify the machine.
The change ads new configuration (see `defaults.yaml`):
* `Machine.Identification` enables configuration of how machines are uniquely identified - I'm not sure about the top level category `Machine`, as I don't have anything else to add to it. Happy to hear suggestions for better naming or structure here.
* `Machine.Identifiation.PrivateId` turns on or off the existing private IP based identification. Default is on.
* `Machine.Identification.Hostname` turns on or off using the OS hostname to identify the machine. Great for most cloud environments, where this tends to be set to something that identifies the machine uniquely. Enabled by default.
* `Machine.Identification.Webhook` configures identification based on the response to an HTTP GET request. Request headers can be configured, a JSONPath can be set for processing the response (no JSON parsing is done if this is not set), and the URL is allowed to contain environment variables in the format `"${var}"`.
The new flow for getting a unique machine id is:
1. PrivateIP (if enabled)
2. Hostname (if enabled)
3. Webhook (if enabled, to configured URL)
4. Give up and error out.
It's important that init configures machine identity first. Otherwise we could try to get an ID before configuring it. To prevent this from causing difficult to debug issues, where for example the default configuration was used, I've ensured that
the application will generate an error if the module hasn't been configured and you try to get an ID.
Misc changes:
* Spelling and gramatical corrections to `init.go::New()` long description.
* Spelling corrections to `verify_zitadel.go::newZitadel()`.
* Updated `production.md` and `development.md` based on the new build process. I think the run instructions are also out of date, but I'll leave that for someone else.
* `id.SonyFlakeGenerator` is now a function, which sets `id.sonyFlakeGenerator`, this allows us to defer initialization until configuration has been read.
* Update internal/id/config.go
Co-authored-by: Alexei-Barnes <82444470+Alexei-Barnes@users.noreply.github.com>
* Fix authored by @livio-a for tests
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2022-05-24 14:57:57 +00:00
|
|
|
func (c *Commands) AddAPIAppCommand(app *addAPIApp, clientSecretAlg crypto.HashAlgorithm) preparation.Validation {
|
2022-04-12 14:20:17 +00:00
|
|
|
return func() (preparation.CreateCommands, error) {
|
|
|
|
if app.ID == "" {
|
|
|
|
return nil, errors.ThrowInvalidArgument(nil, "PROJE-XHsKt", "Errors.Invalid.Argument")
|
|
|
|
}
|
|
|
|
if app.Name = strings.TrimSpace(app.Name); app.Name == "" {
|
|
|
|
return nil, errors.ThrowInvalidArgument(nil, "PROJE-F7g21", "Errors.Invalid.Argument")
|
|
|
|
}
|
|
|
|
return func(ctx context.Context, filter preparation.FilterToQueryReducer) ([]eventstore.Command, error) {
|
|
|
|
project, err := projectWriteModel(ctx, filter, app.Aggregate.ID, app.Aggregate.ResourceOwner)
|
|
|
|
if err != nil || !project.State.Valid() {
|
|
|
|
return nil, errors.ThrowNotFound(err, "PROJE-Sf2gb", "Errors.Project.NotFound")
|
|
|
|
}
|
|
|
|
|
feat: Configurable Unique Machine Identification (#3626)
* feat: Configurable Unique Machine Identification
This change fixes Segfault on AWS App Runner with v2 #3625
The change introduces two new dependencies:
* github.com/drone/envsubst for supporting AWS ECS, which has its metadata endpoint described by an environment variable
* github.com/jarcoal/jpath so that only relevant data from a metadata response is used to identify the machine.
The change ads new configuration (see `defaults.yaml`):
* `Machine.Identification` enables configuration of how machines are uniquely identified - I'm not sure about the top level category `Machine`, as I don't have anything else to add to it. Happy to hear suggestions for better naming or structure here.
* `Machine.Identifiation.PrivateId` turns on or off the existing private IP based identification. Default is on.
* `Machine.Identification.Hostname` turns on or off using the OS hostname to identify the machine. Great for most cloud environments, where this tends to be set to something that identifies the machine uniquely. Enabled by default.
* `Machine.Identification.Webhook` configures identification based on the response to an HTTP GET request. Request headers can be configured, a JSONPath can be set for processing the response (no JSON parsing is done if this is not set), and the URL is allowed to contain environment variables in the format `"${var}"`.
The new flow for getting a unique machine id is:
1. PrivateIP (if enabled)
2. Hostname (if enabled)
3. Webhook (if enabled, to configured URL)
4. Give up and error out.
It's important that init configures machine identity first. Otherwise we could try to get an ID before configuring it. To prevent this from causing difficult to debug issues, where for example the default configuration was used, I've ensured that
the application will generate an error if the module hasn't been configured and you try to get an ID.
Misc changes:
* Spelling and gramatical corrections to `init.go::New()` long description.
* Spelling corrections to `verify_zitadel.go::newZitadel()`.
* Updated `production.md` and `development.md` based on the new build process. I think the run instructions are also out of date, but I'll leave that for someone else.
* `id.SonyFlakeGenerator` is now a function, which sets `id.sonyFlakeGenerator`, this allows us to defer initialization until configuration has been read.
* Update internal/id/config.go
Co-authored-by: Alexei-Barnes <82444470+Alexei-Barnes@users.noreply.github.com>
* Fix authored by @livio-a for tests
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2022-05-24 14:57:57 +00:00
|
|
|
app.ClientID, err = domain.NewClientID(c.idGenerator, project.Name)
|
2022-04-12 14:20:17 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, errors.ThrowInternal(err, "V2-f0pgP", "Errors.Internal")
|
|
|
|
}
|
|
|
|
|
|
|
|
if app.AuthMethodType == domain.APIAuthMethodTypeBasic {
|
2023-07-10 08:07:10 +00:00
|
|
|
code, err := c.newAppClientSecret(ctx, filter, clientSecretAlg)
|
2022-04-12 14:20:17 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2023-07-10 08:07:10 +00:00
|
|
|
app.ClientSecret, app.ClientSecretPlain = code.Crypted, code.Plain
|
2022-04-12 14:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return []eventstore.Command{
|
|
|
|
project_repo.NewApplicationAddedEvent(
|
|
|
|
ctx,
|
|
|
|
&app.Aggregate.Aggregate,
|
|
|
|
app.ID,
|
|
|
|
app.Name,
|
|
|
|
),
|
|
|
|
project_repo.NewAPIConfigAddedEvent(
|
|
|
|
ctx,
|
|
|
|
&app.Aggregate.Aggregate,
|
|
|
|
app.ID,
|
|
|
|
app.ClientID,
|
|
|
|
app.ClientSecret,
|
|
|
|
app.AuthMethodType,
|
|
|
|
),
|
|
|
|
}, nil
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-28 13:42:35 +00:00
|
|
|
func (c *Commands) AddAPIApplicationWithID(ctx context.Context, apiApp *domain.APIApp, resourceOwner, appID string, appSecretGenerator crypto.Generator) (_ *domain.APIApp, err error) {
|
|
|
|
existingAPI, err := c.getAPIAppWriteModel(ctx, apiApp.AggregateID, appID, resourceOwner)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2022-07-28 13:42:35 +00:00
|
|
|
if existingAPI.State != domain.AppStateUnspecified {
|
2022-10-18 15:07:30 +00:00
|
|
|
return nil, errors.ThrowPreconditionFailed(nil, "PROJECT-mabu12", "Errors.Project.App.AlreadyExisting")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
2022-07-28 13:42:35 +00:00
|
|
|
project, err := c.getProjectByID(ctx, apiApp.AggregateID, resourceOwner)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
2022-07-28 13:42:35 +00:00
|
|
|
return nil, errors.ThrowPreconditionFailed(err, "PROJECT-9fnsa", "Errors.Project.NotFound")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
2022-07-28 13:42:35 +00:00
|
|
|
|
|
|
|
return c.addAPIApplicationWithID(ctx, apiApp, resourceOwner, project, appID, appSecretGenerator)
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 13:42:35 +00:00
|
|
|
func (c *Commands) AddAPIApplication(ctx context.Context, apiApp *domain.APIApp, resourceOwner string, appSecretGenerator crypto.Generator) (_ *domain.APIApp, err error) {
|
|
|
|
if apiApp == nil || apiApp.AggregateID == "" {
|
2022-10-18 15:07:30 +00:00
|
|
|
return nil, errors.ThrowInvalidArgument(nil, "PROJECT-5m9E", "Errors.Project.App.Invalid")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
2022-07-28 13:42:35 +00:00
|
|
|
project, err := c.getProjectByID(ctx, apiApp.AggregateID, resourceOwner)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
2022-07-28 13:42:35 +00:00
|
|
|
return nil, errors.ThrowPreconditionFailed(err, "PROJECT-9fnsf", "Errors.Project.NotFound")
|
|
|
|
}
|
|
|
|
|
|
|
|
if !apiApp.IsValid() {
|
2022-10-18 15:07:30 +00:00
|
|
|
return nil, errors.ThrowInvalidArgument(nil, "PROJECT-Bff2g", "Errors.Project.App.Invalid")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 13:42:35 +00:00
|
|
|
appID, err := c.idGenerator.Next()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return c.addAPIApplicationWithID(ctx, apiApp, resourceOwner, project, appID, appSecretGenerator)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Commands) addAPIApplicationWithID(ctx context.Context, apiApp *domain.APIApp, resourceOwner string, project *domain.Project, appID string, appSecretGenerator crypto.Generator) (_ *domain.APIApp, err error) {
|
|
|
|
apiApp.AppID = appID
|
|
|
|
|
|
|
|
addedApplication := NewAPIApplicationWriteModel(apiApp.AggregateID, resourceOwner)
|
|
|
|
projectAgg := ProjectAggregateFromWriteModel(&addedApplication.WriteModel)
|
|
|
|
|
|
|
|
events := []eventstore.Command{
|
|
|
|
project_repo.NewApplicationAddedEvent(ctx, projectAgg, apiApp.AppID, apiApp.AppName),
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var stringPw string
|
2022-07-28 13:42:35 +00:00
|
|
|
err = domain.SetNewClientID(apiApp, c.idGenerator, project)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
2022-07-28 13:42:35 +00:00
|
|
|
return nil, err
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
2022-07-28 13:42:35 +00:00
|
|
|
stringPw, err = domain.SetNewClientSecretIfNeeded(apiApp, appSecretGenerator)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
2022-07-28 13:42:35 +00:00
|
|
|
return nil, err
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
2022-04-12 14:20:17 +00:00
|
|
|
events = append(events, project_repo.NewAPIConfigAddedEvent(ctx,
|
2021-02-22 11:27:47 +00:00
|
|
|
projectAgg,
|
2022-07-28 13:42:35 +00:00
|
|
|
apiApp.AppID,
|
|
|
|
apiApp.ClientID,
|
|
|
|
apiApp.ClientSecret,
|
|
|
|
apiApp.AuthMethodType))
|
2021-02-22 11:27:47 +00:00
|
|
|
|
2022-07-28 13:42:35 +00:00
|
|
|
addedApplication.AppID = apiApp.AppID
|
|
|
|
pushedEvents, err := c.eventstore.Push(ctx, events...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
err = AppendAndReduce(addedApplication, pushedEvents...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
result := apiWriteModelToAPIConfig(addedApplication)
|
|
|
|
result.ClientSecretString = stringPw
|
|
|
|
return result, nil
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 10:17:39 +00:00
|
|
|
func (c *Commands) ChangeAPIApplication(ctx context.Context, apiApp *domain.APIApp, resourceOwner string) (*domain.APIApp, error) {
|
2021-04-09 09:50:06 +00:00
|
|
|
if apiApp.AppID == "" || apiApp.AggregateID == "" {
|
2022-04-12 14:20:17 +00:00
|
|
|
return nil, errors.ThrowInvalidArgument(nil, "COMMAND-1m900", "Errors.Project.App.APIConfigInvalid")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 10:17:39 +00:00
|
|
|
existingAPI, err := c.getAPIAppWriteModel(ctx, apiApp.AggregateID, apiApp.AppID, resourceOwner)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if existingAPI.State == domain.AppStateUnspecified || existingAPI.State == domain.AppStateRemoved {
|
2022-04-12 14:20:17 +00:00
|
|
|
return nil, errors.ThrowNotFound(nil, "COMMAND-2n8uU", "Errors.Project.App.NotExisting")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
2021-06-27 09:20:59 +00:00
|
|
|
if !existingAPI.IsAPI() {
|
2022-04-12 14:20:17 +00:00
|
|
|
return nil, errors.ThrowInvalidArgument(nil, "COMMAND-Gnwt3", "Errors.Project.App.IsNotAPI")
|
2021-06-27 09:20:59 +00:00
|
|
|
}
|
2021-02-22 11:27:47 +00:00
|
|
|
projectAgg := ProjectAggregateFromWriteModel(&existingAPI.WriteModel)
|
|
|
|
changedEvent, hasChanged, err := existingAPI.NewChangedEvent(
|
|
|
|
ctx,
|
|
|
|
projectAgg,
|
|
|
|
apiApp.AppID,
|
|
|
|
apiApp.AuthMethodType)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if !hasChanged {
|
2022-04-12 14:20:17 +00:00
|
|
|
return nil, errors.ThrowPreconditionFailed(nil, "COMMAND-1m88i", "Errors.NoChangesFound")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
|
|
|
|
2022-01-03 08:19:07 +00:00
|
|
|
pushedEvents, err := c.eventstore.Push(ctx, changedEvent)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
err = AppendAndReduce(existingAPI, pushedEvents...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2021-03-15 11:51:15 +00:00
|
|
|
return apiWriteModelToAPIConfig(existingAPI), nil
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
|
|
|
|
2022-02-16 15:49:17 +00:00
|
|
|
func (c *Commands) ChangeAPIApplicationSecret(ctx context.Context, projectID, appID, resourceOwner string, appSecretGenerator crypto.Generator) (*domain.APIApp, error) {
|
2021-02-22 11:27:47 +00:00
|
|
|
if projectID == "" || appID == "" {
|
2022-04-12 14:20:17 +00:00
|
|
|
return nil, errors.ThrowInvalidArgument(nil, "COMMAND-99i83", "Errors.IDMissing")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 10:17:39 +00:00
|
|
|
existingAPI, err := c.getAPIAppWriteModel(ctx, projectID, appID, resourceOwner)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if existingAPI.State == domain.AppStateUnspecified || existingAPI.State == domain.AppStateRemoved {
|
2022-04-12 14:20:17 +00:00
|
|
|
return nil, errors.ThrowNotFound(nil, "COMMAND-2g66f", "Errors.Project.App.NotExisting")
|
2021-02-22 11:27:47 +00:00
|
|
|
}
|
2021-06-27 09:20:59 +00:00
|
|
|
if !existingAPI.IsAPI() {
|
2022-04-12 14:20:17 +00:00
|
|
|
return nil, errors.ThrowInvalidArgument(nil, "COMMAND-aeH4", "Errors.Project.App.IsNotAPI")
|
2021-06-27 09:20:59 +00:00
|
|
|
}
|
2022-02-16 15:49:17 +00:00
|
|
|
cryptoSecret, stringPW, err := domain.NewClientSecret(appSecretGenerator)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
projectAgg := ProjectAggregateFromWriteModel(&existingAPI.WriteModel)
|
|
|
|
|
2022-04-12 14:20:17 +00:00
|
|
|
pushedEvents, err := c.eventstore.Push(ctx, project_repo.NewAPIConfigSecretChangedEvent(ctx, projectAgg, appID, cryptoSecret))
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
err = AppendAndReduce(existingAPI, pushedEvents...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
result := apiWriteModelToAPIConfig(existingAPI)
|
|
|
|
result.ClientSecretString = stringPW
|
|
|
|
return result, err
|
|
|
|
}
|
2021-10-26 09:33:59 +00:00
|
|
|
|
|
|
|
func (c *Commands) VerifyAPIClientSecret(ctx context.Context, projectID, appID, secret string) (err error) {
|
|
|
|
ctx, span := tracing.NewSpan(ctx)
|
|
|
|
defer func() { span.EndWithError(err) }()
|
|
|
|
|
|
|
|
app, err := c.getAPIAppWriteModel(ctx, projectID, appID, "")
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if !app.State.Exists() {
|
2022-04-12 14:20:17 +00:00
|
|
|
return errors.ThrowPreconditionFailed(nil, "COMMAND-DFnbf", "Errors.Project.App.NoExisting")
|
2021-10-26 09:33:59 +00:00
|
|
|
}
|
|
|
|
if !app.IsAPI() {
|
2022-04-12 14:20:17 +00:00
|
|
|
return errors.ThrowInvalidArgument(nil, "COMMAND-Bf3fw", "Errors.Project.App.IsNotAPI")
|
2021-10-26 09:33:59 +00:00
|
|
|
}
|
|
|
|
if app.ClientSecret == nil {
|
2022-04-12 14:20:17 +00:00
|
|
|
return errors.ThrowPreconditionFailed(nil, "COMMAND-D3t5g", "Errors.Project.App.APIConfigInvalid")
|
2021-10-26 09:33:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
projectAgg := ProjectAggregateFromWriteModel(&app.WriteModel)
|
|
|
|
ctx, spanPasswordComparison := tracing.NewNamedSpan(ctx, "crypto.CompareHash")
|
2023-07-14 06:49:57 +00:00
|
|
|
err = crypto.CompareHash(app.ClientSecret, []byte(secret), c.codeAlg)
|
2021-10-26 09:33:59 +00:00
|
|
|
spanPasswordComparison.EndWithError(err)
|
|
|
|
if err == nil {
|
2022-04-12 14:20:17 +00:00
|
|
|
_, err = c.eventstore.Push(ctx, project_repo.NewAPIConfigSecretCheckSucceededEvent(ctx, projectAgg, app.AppID))
|
2021-10-26 09:33:59 +00:00
|
|
|
return err
|
|
|
|
}
|
2022-04-12 14:20:17 +00:00
|
|
|
_, err = c.eventstore.Push(ctx, project_repo.NewAPIConfigSecretCheckFailedEvent(ctx, projectAgg, app.AppID))
|
2021-10-26 09:33:59 +00:00
|
|
|
logging.Log("COMMAND-g3f12").OnError(err).Error("could not push event APIClientSecretCheckFailed")
|
2022-04-12 14:20:17 +00:00
|
|
|
return errors.ThrowInvalidArgument(nil, "COMMAND-SADfg", "Errors.Project.App.ClientSecretInvalid")
|
2021-10-26 09:33:59 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 10:17:39 +00:00
|
|
|
func (c *Commands) getAPIAppWriteModel(ctx context.Context, projectID, appID, resourceOwner string) (*APIApplicationWriteModel, error) {
|
2021-02-22 11:27:47 +00:00
|
|
|
appWriteModel := NewAPIApplicationWriteModelWithAppID(projectID, appID, resourceOwner)
|
2021-02-24 10:17:39 +00:00
|
|
|
err := c.eventstore.FilterToQueryReducer(ctx, appWriteModel)
|
2021-02-22 11:27:47 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return appWriteModel, nil
|
|
|
|
}
|