Skip to content

Commit

Permalink
Change getPrecomputedAssignments obfuscated default because the preco…
Browse files Browse the repository at this point in the history
…mputed client is hard coded to expect an obfuscated input
  • Loading branch information
sameerank committed Jan 9, 2025
1 parent 65986fe commit 52d06fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/client/eppo-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('EppoClient E2E test', () => {
});

it('skips disabled flags', () => {
const encodedPrecomputedWire = client.getPrecomputedAssignments('subject', {});
const encodedPrecomputedWire = client.getPrecomputedAssignments('subject', {}, false);
const { precomputed } = JSON.parse(encodedPrecomputedWire) as IConfigurationWire;
if (!precomputed) {
fail('Precomputed data not in Configuration response');
Expand All @@ -229,7 +229,7 @@ describe('EppoClient E2E test', () => {
});

it('evaluates and returns assignments', () => {
const encodedPrecomputedWire = client.getPrecomputedAssignments('subject', {});
const encodedPrecomputedWire = client.getPrecomputedAssignments('subject', {}, false);
const { precomputed } = JSON.parse(encodedPrecomputedWire) as IConfigurationWire;
if (!precomputed) {
fail('Precomputed data not in Configuration response');
Expand All @@ -248,7 +248,7 @@ describe('EppoClient E2E test', () => {
// Use a known salt to produce deterministic hashes
setSaltOverrideForTests(new Uint8Array([7, 53, 17, 78]));

const encodedPrecomputedWire = client.getPrecomputedAssignments('subject', {}, true);
const encodedPrecomputedWire = client.getPrecomputedAssignments('subject', {});
const { precomputed } = JSON.parse(encodedPrecomputedWire) as IConfigurationWire;
if (!precomputed) {
fail('Precomputed data not in Configuration response');
Expand Down
2 changes: 1 addition & 1 deletion src/client/eppo-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ export default class EppoClient {
getPrecomputedAssignments(
subjectKey: string,
subjectAttributes: Attributes | ContextAttributes = {},
obfuscated = false,
obfuscated = true,
): string {
const configDetails = this.getConfigDetails();

Expand Down

0 comments on commit 52d06fb

Please sign in to comment.