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

Change tag in discovery service to simple lamport clock value (int) #3098

Merged
merged 13 commits into from
May 13, 2024

Conversation

woutslakhorst
Copy link
Member

@woutslakhorst woutslakhorst commented May 8, 2024

closes #2955

named it timestamp, spec and interface explain that it's not a unix timestamp...
Added forwarding of calls if a client receives Get/Register.

see nuts-foundation/nuts-specification#274 for spec changes.

@woutslakhorst woutslakhorst requested a review from reinkrul May 8, 2024 12:36
@woutslakhorst woutslakhorst marked this pull request as ready for review May 8, 2024 12:36
@woutslakhorst woutslakhorst force-pushed the feature/2955/discovery_server_migrate branch from b24f79e to c9c9541 Compare May 13, 2024 08:57
Copy link
Member

@reinkrul reinkrul left a comment

Choose a reason for hiding this comment

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

And the thing about detecting when you're forwarding to your own node.

discovery/interface.go Outdated Show resolved Hide resolved
discovery/interface.go Outdated Show resolved Hide resolved
discovery/interface.go Outdated Show resolved Hide resolved
discovery/interface.go Outdated Show resolved Hide resolved
discovery/module.go Outdated Show resolved Hide resolved
tag_prefix varchar(5) null
id varchar(200) not null primary key,
-- last_timestamp is the latest lamport_timestamp pointing to the last presentation registered on the service.
last_timestamp integer not null
Copy link
Member

Choose a reason for hiding this comment

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

in discovery_presentation this is called lamport_timestamp. Call it last_lamport_timestamp here, or timestamp in the other table?

echoCtx := ctx.Value("echo.Context")
if echoCtx != nil {
// forward X-Forwarded-Host header via context
ctx = context.WithValue(ctx, "X-Forwarded-Host", echoCtx.(echo.Context).Request().Header.Get("X-Forwarded-Host"))
Copy link
Member

Choose a reason for hiding this comment

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

const

echoCtx := ctx.Value("echo.Context")
if echoCtx != nil {
// forward X-Forwarded-Host header via context
ctx = context.WithValue(ctx, "X-Forwarded-Host", echoCtx.(echo.Context).Request().Header.Get("X-Forwarded-Host"))
Copy link
Member

Choose a reason for hiding this comment

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

you shouldn't use string values for context keys, but unexported structs (codeclimate will complain)

@woutslakhorst woutslakhorst force-pushed the feature/2955/discovery_server_migrate branch from 9d07e97 to 9287229 Compare May 13, 2024 13:11
@woutslakhorst woutslakhorst merged commit c939dc1 into master May 13, 2024
9 checks passed
@woutslakhorst woutslakhorst deleted the feature/2955/discovery_server_migrate branch May 13, 2024 13:31
rolandgroen added a commit that referenced this pull request May 23, 2024
* refs/heads/master: (71 commits)
  Remove nonce from default Request Object params (#3125)
  Burn nonce type SessionStore entries after first use (#3123)
  Crypto: alter Storage interface to create keys inside key store (#3120)
  Crypto: let Exists() return an error if one occurs (#3127)
  Bump github.com/nats-io/nats-server/v2 from 2.10.14 to 2.10.15 (#3121)
  Bump github.com/nats-io/nats.go from 1.34.1 to 1.35.0 (#3122)
  Bump google.golang.org/grpc from 1.63.2 to 1.64.0 (#3119)
  Bump azure/setup-helm from 3.5 to 4 (#3050)
  cleanup oauth constants (#3117)
  prevent panic (#3118)
  Support request_uri_method=post (#3102)
  add GetAndDelete to SessionStore (#3116)
  bugfix: redirect browser instead of returning error when requested scope is unknown (3104) (#3113)
  SQL: Fix SQL Server e2e test connection strings (#3112)
  Docs: updated v6 release notes to include missing stuff (#3108)
  IAM: nil deref when re-using same user session (#3106)
  cleanup metadata (#3103)
  Docs: fixed MySql example DSN (#3110)
  Change tag in discovery service to simple lamport clock value (int) (#3098)
  e2e tests: have Nuts containers wait for DB container healthy (#3109)
  ...

# Conflicts:
#	charts/nuts-node/values.yaml
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.

Discovery: describe how to migrate endpoint and hoster
2 participants