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

feat: Support disable flag for mediatype validator #675

Merged

Conversation

ilya-korotya
Copy link
Contributor

No description provided.

@ilya-korotya ilya-korotya requested a review from a team as a code owner June 20, 2024 14:23
@ilya-korotya ilya-korotya changed the base branch from main to develop June 20, 2024 14:23
cmd/platform/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@x1m3 x1m3 left a comment

Choose a reason for hiding this comment

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

LGTM

@x1m3 x1m3 changed the title feature: support disable flag for mediatype validator feat: Support disable flag for mediatype validator Jun 20, 2024
cmd/pending_publisher/main.go Outdated Show resolved Hide resolved
cmd/notifications/main.go Outdated Show resolved Hide resolved
cmd/platform_ui/main.go Outdated Show resolved Hide resolved
internal/api/server_test.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
@@ -634,6 +644,11 @@ func checkEnvVars(ctx context.Context, cfg *Configuration) {
cfg.AutoPublishingToOnChainRHS = common.ToPointer(true)
}

if cfg.MediaTypeManager.StrictMode == nil {
log.Info(ctx, "ISSUER_MEDIA_TYPE_MANAGER_STRICT_MODE is missing and the server set up it as true")
Copy link
Contributor

@vmidyllic vmidyllic Jun 20, 2024

Choose a reason for hiding this comment

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

server set up it as true? how is that possible? why do we need it? default value, which can be overwritten by config. You will need then always to set it? That's not a plan. Now I even don't know why we need both enabled and strict mode

internal/core/services/mediatype_manager.go Outdated Show resolved Hide resolved
internal/core/services/mediatype_manager.go Outdated Show resolved Hide resolved
Comment on lines 28 to 33
// bytePubsig, err := json.Marshal(pubsignals)
// if err != nil {
// return err
// }

// authPubSignals := circuits.AuthV2PubSignals{}
Copy link
Contributor

Choose a reason for hiding this comment

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

do you need to comment everything???

Copy link
Contributor Author

Choose a reason for hiding this comment

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

miss this. sorry. I did some tests yesterday.

internal/core/services/mediatype_manager.go Outdated Show resolved Hide resolved
@@ -201,6 +202,11 @@ type APIUIAuth struct {
Password string `mapstructure:"Password" tip:"Server UI API Basic auth password"`
}

// MediaTypeManager enables or disables the media types manager
type MediaTypeManager struct {
Enabled *bool `mapstructure:"Enabled" tip:"Enable or disable the media type manager"`
Copy link
Contributor

Choose a reason for hiding this comment

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

update .env file sample, please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -51,6 +51,7 @@ type Configuration struct {
CredentialStatus CredentialStatus `mapstructure:"CredentialStatus"`
CustomDIDMethods []CustomDIDMethods `mapstructure:"-"`
AutoPublishingToOnChainRHS *bool `mapstructure:"AutoPublishingToOnChainRHS"`
MediaTypeManager MediaTypeManager `mapstructure:"MediaTypeManager"`
Copy link
Contributor

Choose a reason for hiding this comment

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

update env file sample, please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

&merkletree.HashZero,
&merkletree.HashZero,
},
if len(rhsPublishers) > 0 && !(rhsMode == reverse_hash.RHSModeOnChain && !i.autoPublishingToOnChainRHS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be documented in the readme or in a good document in notion

@ilya-korotya ilya-korotya merged commit ac4e402 into develop Jun 20, 2024
2 checks passed
@ilya-korotya ilya-korotya deleted the feature/support-disable-flag-for-mediatype-checker branch June 20, 2024 17:54
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