Skip to content

CallCredentials interface, 2nd edition #4901

@zhangkun83

Description

@zhangkun83

Security level and authority are parameters required to be passed to applyRequestMetadata(). We will wrap them, along with MethodDescriptor and the transport attributes, to a first-class object RequestInfo, which is more clear to the implementers than via Attributes.

ATTR_SECURITY_LEVEL will be moved to the internal GrpcAttributes and annotated as TransportAttr, because transports are required to set it, but no user is actually reading them from
{Client,Server}Call.getAttributes().

ATTR_AUTHORITY should be removed, because no transport is overriding it.

This is an API-breaking change because CallCredentials is interface. It will be changed to abstract class, so that further API changes can be done in multiple steps without breaking implementations.

The CallCredentials name is stabilized, thus it must be the name of the new interface. We will take the following steps to finish the change.

  1. Introduce CallCredentials2, which is the new API, which implements the old CallCredentials. Change all stock implementations to it. Deprecate the old CallCredentials.
  2. Make a release, and ask all implementations (including FirestoreCallCredentials) to implement CallCredentials2 instead.
  3. Replace CallCredentials with CallCredentials2, keeping CallCredentials2 as an alias.
  4. Make a release, and ask all implementations (including FirestoreCallCredentials) to switch back to the name CallCredentials.
  5. Delete the alias CallCredentials2

During the whole process, the name CallCredentials stays usable, and we require no change in code that passes CallCredentials objects along.

/cc @ejona86

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions