syntax = "proto3";
package spire.agent.debug.v1;
option go_package = "github.com/spiffe/spire-api-sdk/proto/spire/api/agent/debug/v1;debugv1";

import "spire/api/types/spiffeid.proto";

service Debug {
    // Get information about SPIRE agent
    rpc GetInfo(GetInfoRequest) returns (GetInfoResponse);
}

message GetInfoRequest {
}

message GetInfoResponse {
    message Cert {
        // Cerfificate SPIFFE ID
        spire.api.types.SPIFFEID id = 1;
        // Expiration time
        int64 expires_at = 2;
        // Subject
        string subject = 3;
    }

    // Agent SVID chain
    repeated Cert svid_chain = 1;
    // Agent uptime in seconds
    int32 uptime = 2;
    // Number of SVIDs cached in memory
    // Deprecated in favor of cached_x509_svids_count, cached_jwt_svids_count, and cached_svidstore_x509_svids_count
    int32 svids_count = 3 [deprecated=true];
    // last successful sync with server (in seconds since unix epoch)
    int64 last_sync_success = 4;
    // Number of X.509-SVIDs in Agent primary in-memory cache
    int32 cached_x509_svids_count = 5;
    // Number of JWT-SVIDs in Agent primary in-memory cache
    int32 cached_jwt_svids_count = 6;
    // Number of X.509-SVIDs in Agent svidstore in-memory cache
    int32 cached_svidstore_x509_svids_count = 7;
}
