parse: (
value: any,
) =>
| {
id?: undefined;
ok: boolean;
path?: undefined;
reason: string;
segments?: undefined;
trustDomain?: undefined;
}
| {
id: string;
ok: boolean;
path: string;
reason?: undefined;
segments: any[];
trustDomain: string;
} = ...
Type Declaration
-
- (
value: any,
):
| {
id?: undefined;
ok: boolean;
path?: undefined;
reason: string;
segments?: undefined;
trustDomain?: undefined;
}
| {
id: string;
ok: boolean;
path: string;
reason?: undefined;
segments: any[];
trustDomain: string;
}
-
Returns
| {
id?: undefined;
ok: boolean;
path?: undefined;
reason: string;
segments?: undefined;
trustDomain?: undefined;
}
| {
id: string;
ok: boolean;
path: string;
reason?: undefined;
segments: any[];
trustDomain: string;
}
{ ok: true, id, trustDomain, path, segments }, path being ''
for a trust-domain-only identifier, or { ok: false, reason }
Parses a SPIFFE ID against the specification's grammar.