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(fdc): Add support for Data Connect Impersonation #2844

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

jonathanedey
Copy link
Contributor

No description provided.

@jonathanedey jonathanedey added the release:stage Stage a release candidate label Feb 10, 2025
@jonathanedey jonathanedey marked this pull request as ready for review February 10, 2025 17:56
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

Thanks Jonathan! LGTM!

// @public
export interface ImpersonateAuthenticated {
// Warning: (ae-forgotten-export) The symbol "DecodedIdToken" needs to be exported by the entry point index.d.ts
authClaims: Partial<DecodedIdToken>;
Copy link
Member

Choose a reason for hiding this comment

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

Should this type be re-exported from src/data-connect/index.ts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Offline notes:

  • Exporting DecodedIdToken here would require more auth types to be exported in src/data-connect/index.ts to satisfy api doc generation which isn't ideal.
  • Exporting an aliased type works around this and better documents the type in the data connect context.

Exported the aliased type AuthClaims.

.should.eventually.be.rejected.and.has.property('code', 'data-connect/unauthenticated');
});

it('executeGraphql() successfully executes an impersonated query with non-existing authenticated claims',
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe reword this to: "should return an empty list for an impersonated query with non-existing authenticated claims"

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!

kjelko and others added 5 commits February 14, 2025 12:01
…erver side SDK. (#2829)

* add serialization method to server side remote config

* update with latest changes

* restructure as a class, add documentation

* more tests for server config

* run apidocs

* Refine api and rerun docs

* add back the newline

* Apply suggestions from review

* Make eTag optional in fetch response

* rerun doc generator

---------

Co-authored-by: Kevin Elko <kjelko@google.com>
export interface ImpersonateAuthenticated {
/**
* Evaluate the auth policy with a customized JWT auth token. Should follow the Firebase Auth token format.
* https://firebase.google.com/docs/rules/rules-and-auth

Choose a reason for hiding this comment

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

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!

@@ -6,6 +6,11 @@

import { Agent } from 'http';

// Warning: (ae-forgotten-export) The symbol "DecodedIdToken" needs to be exported by the entry point index.d.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to re-export the DecodedIdToken here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Offline notes:

  • Exporting DecodedIdToken here would require more auth types to be exported in src/data-connect/index.ts to satisfy api doc generation which isn't ideal.
  • Exporting an aliased type works around this and better documents the type in the data connect context.

Exported the aliased type AuthClaims.

From my understanding it isn't necessary and the AuthClaims export alias should provide the necessary types. @lahirumaramba Correct me if i'm mistaken here.

expect(resp.data.users[0].name).to.be.not.undefined;
expect(resp.data.users[0].address).to.be.not.undefined;
expect(resp.data.users.length).to.be.greaterThan(1);
expect(resp.data.users[0].uid).to.not.be.undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be checking the values here? Unless we already have that in a test somewhere else

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we should be checking the other indexes. Updated this and similar cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:stage Stage a release candidate release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants