Skip to content

Conversation

rowanseymour
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings September 5, 2025 20:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for obfuscated ID handling by implementing a configurable obfuscation key system. The key functionality enables contact queries to be performed using obfuscated references instead of direct database IDs.

  • Adds ID obfuscation key configuration and parsing functionality
  • Integrates obfuscation key into organization environment for flow execution
  • Updates dependency to goflow v0.255.6 which likely includes contact reference support

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
runtime/config.go Adds IDObfuscationKey field and hex parsing method
runtime/config_test.go Tests for the ID obfuscation key parsing functionality
core/models/org.go Integrates obfuscation key into organization environment
core/models/org_test.go Updates tests to pass config to LoadOrg calls
core/models/assets.go Updates LoadOrg call to include config parameter
go.mod Updates goflow dependency to v0.255.6

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -91,6 +91,22 @@ type Org struct {
env envs.Environment
}

// Enviroment allows overriding values from config
Copy link
Preview

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

Environment" is misspelled as "Enviroment" in the comment.

Suggested change
// Enviroment allows overriding values from config
// Environment allows overriding values from config

Copilot uses AI. Check for mistakes.

Comment on lines +65 to +68
0x000A3B1C, // first 4 bytes
0x000D2E3F, // second 4 bytes
0x0001A2B3, // third 4 bytes
0x00C0FFEE, // fourth 4 bytes
Copy link
Preview

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

The expected values in the test don't match the input hex string. The hex string '000A3B1C000D2E3F0001A2B300C0FFEE' should produce [0x000A3B1C, 0x000D2E3F, 0x0001A2B3, 0x00C0FFEE] but the test expects different values without the leading zeros.

Copilot uses AI. Check for mistakes.

@@ -42,22 +42,24 @@ func TestLoadOrg(t *testing.T) {
assert.Equal(t, envs.DateFormatDayMonthYear, org.Environment().DateFormat())
assert.Equal(t, envs.TimeFormatHourMinute, org.Environment().TimeFormat())
assert.Equal(t, envs.RedactionPolicyNone, org.Environment().RedactionPolicy())
assert.Equal(t, [4]uint32{0xA3B1C, 0xD2E3F, 0x1A2B3, 0xC0FFEE}, org.Environment().ObfuscationKey())
Copy link
Preview

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

The expected obfuscation key values don't match the default configuration. The default key '000A3B1C000D2E3F0001A2B300C0FFEE' should produce [0x000A3B1C, 0x000D2E3F, 0x0001A2B3, 0x00C0FFEE] but the test expects values without leading zeros.

Copilot uses AI. Check for mistakes.

assert.NoError(t, err)
assert.True(t, org.Suspended())
assert.Equal(t, "", org.FlowSMTP())
assert.Equal(t, envs.DateFormatMonthDayYear, org.Environment().DateFormat())
assert.Equal(t, []i18n.Language{}, org.Environment().AllowedLanguages())
assert.Equal(t, i18n.NilLanguage, org.Environment().DefaultLanguage())
assert.Equal(t, i18n.NilLocale, org.Environment().DefaultLocale())
assert.Equal(t, [4]uint32{0xA3B1C, 0xD2E3F, 0x1A2B3, 0xC0FFEE}, org.Environment().ObfuscationKey())
Copy link
Preview

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

The expected obfuscation key values don't match the default configuration. The default key '000A3B1C000D2E3F0001A2B300C0FFEE' should produce [0x000A3B1C, 0x000D2E3F, 0x0001A2B3, 0x00C0FFEE] but the test expects values without leading zeros.

Copilot uses AI. Check for mistakes.

@rowanseymour rowanseymour merged commit a5ee48e into main Sep 5, 2025
4 checks passed
@rowanseymour rowanseymour deleted the search_by_ref branch September 5, 2025 21:02
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant