AuthFeatures checks the unauthenticated meta endpoint for GHES support.
()
| 608 | |
| 609 | // AuthFeatures checks the unauthenticated meta endpoint for GHES support. |
| 610 | func (d *detector) AuthFeatures() (AuthFeatures, error) { |
| 611 | if !ghauth.IsEnterprise(d.host) { |
| 612 | return AuthFeatures{ExpiringTokens: true}, nil |
| 613 | } |
| 614 | |
| 615 | hostVersion, err := resolveEnterpriseVersion(d.client(), d.host) |
| 616 | if err != nil { |
| 617 | return AuthFeatures{}, err |
| 618 | } |
| 619 | |
| 620 | return AuthFeatures{ |
| 621 | ExpiringTokens: hostVersion.GreaterThanOrEqual(version.Must(version.NewVersion("3.23.0"))), |
| 622 | }, nil |
| 623 | } |
| 624 | |
| 625 | const eventsFeatureDetectionTimeout = 3 * time.Second |
| 626 |
nothing calls this directly
no test coverage detected