Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 2.15 KB

L103-core-move-insecure-creds-declaration.md

File metadata and controls

44 lines (29 loc) · 2.15 KB

L103: C-core: Move function declarations for each credential type from grpc/grpc_security.h to its own header file

Abstract

Move function declarations for each credential type from grpc/grpc_security.h to its own header file.

Background

Previously, the PR grpc/grpc#25586 helps move us to an eventual future where each type of credentials is in its own build target, so applications can link in only the specific one(s) they need.

However, the issue grpc/grpc#31012 points out the fact that grpc/grpc_security.h contains functions that has nothing to do with secure credentials, which contradicts with the goal we would like to achieve in the PR above.

Proposal

Move function declarations for each credential type from grpc/grpc_security.h to its own header file. The following is the list of mapping.

  • google_default_credentials: grpc/channel_credentials/google_default.h
  • ssl_credentials: grpc/channel_credentials/ssl.h
  • alts_credentials: grpc/channel_credentials/alts.h
  • local_credentials: grpc/channel_credentials/local.h
  • tls_credentials: grpc/channel_credentials/tls.h
  • insecure_credentials: grpc/channel_credentials/insecure.h
  • xds_credentials: grpc/channel_credentials/xds.h

Rationale

Moving function declarations to grpc/grpc.h seems to be convenient but not right. Moving them to their own files makes more sense because our goal is to make every credential type have its own target.

Note that we do not plan to reserve backward compatibility by including grpc/channel_credentials/*.h in grpc/grpc_security.h since we do not promise backward compatibility for C-core API.

Implementation

Move function declarations for each credential type from grpc/grpc_security.h to its own header file as indicated in the "Proposal" section.

Open issues (if applicable)

grpc/grpc#31012