AutonomyReasonOf extracts a deterministic autonomy reason code from an error.
(err error)
| 47 | |
| 48 | // AutonomyReasonOf extracts a deterministic autonomy reason code from an error. |
| 49 | func AutonomyReasonOf(err error) (AutonomyReasonCode, bool) { |
| 50 | var autonomyErr *AutonomyError |
| 51 | if errors.As(err, &autonomyErr) && autonomyErr.Reason != "" { |
| 52 | return autonomyErr.Reason, true |
| 53 | } |
| 54 | return "", false |
| 55 | } |
| 56 | |
| 57 | // AutonomyLeaseAuthority resolves the internal lease credential for the calling |
| 58 | // session without exposing the raw claim token at public boundaries. |
no outgoing calls