Skip to content

Commit

Permalink
update aes registration
Browse files Browse the repository at this point in the history
  • Loading branch information
kkumar-gcc committed Sep 29, 2024
1 parent 1697335 commit bdcffb4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crypt/service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ type ServiceProvider struct {

func (crypt *ServiceProvider) Register(app foundation.Application) {
app.Singleton(Binding, func(app foundation.Application) (any, error) {
return NewAES(app.MakeConfig(), app.GetJson())
c := app.MakeConfig()
if c == nil {
return nil, ErrConfigNotSet

Check warning on line 16 in crypt/service_provider.go

View check run for this annotation

Codecov / codecov/patch

crypt/service_provider.go#L14-L16

Added lines #L14 - L16 were not covered by tests
}

j := app.GetJson()
if j == nil {
return nil, ErrJsonParserNotSet

Check warning on line 21 in crypt/service_provider.go

View check run for this annotation

Codecov / codecov/patch

crypt/service_provider.go#L19-L21

Added lines #L19 - L21 were not covered by tests
}

return NewAES(c, j)

Check warning on line 24 in crypt/service_provider.go

View check run for this annotation

Codecov / codecov/patch

crypt/service_provider.go#L24

Added line #L24 was not covered by tests
})
}

Expand Down

0 comments on commit bdcffb4

Please sign in to comment.