|
| 1 | +package graph |
| 2 | + |
| 3 | +// Endpoint constants represent the URL suffixes used for Jamf API token interactions. |
| 4 | +const ( |
| 5 | + APIName = "graph" // APIName: represents the name of the API. |
| 6 | + DefaultBaseDomain = "graph.microsoft.com" // DefaultBaseDomain: represents the base domain for the jamf instance. |
| 7 | + OAuthTokenEndpoint = "" // OAuthTokenEndpoint: The endpoint to obtain an OAuth token. |
| 8 | + BearerTokenEndpoint = "" // BearerTokenEndpoint: The endpoint to obtain a bearer token. |
| 9 | + TokenRefreshEndpoint = "" // TokenRefreshEndpoint: The endpoint to refresh an existing token. |
| 10 | + TokenInvalidateEndpoint = "" // TokenInvalidateEndpoint: The endpoint to invalidate an active token. |
| 11 | + BearerTokenAuthenticationSupport = true // BearerTokenAuthSuppport: A boolean to indicate if the API supports bearer token authentication. |
| 12 | + OAuthAuthenticationSupport = true // OAuthAuthSuppport: A boolean to indicate if the API supports OAuth authentication. |
| 13 | + OAuthWithCertAuthenticationSupport = true // OAuthWithCertAuthSuppport: A boolean to indicate if the API supports OAuth with client certificate authentication. |
| 14 | +) |
| 15 | + |
| 16 | +// GetDefaultBaseDomain returns the default base domain used for constructing API URLs to the http client. |
| 17 | +func (g *GraphAPIHandler) GetDefaultBaseDomain() string { |
| 18 | + return DefaultBaseDomain |
| 19 | +} |
| 20 | + |
| 21 | +// GetOAuthTokenEndpoint returns the endpoint for obtaining an OAuth token. Used for constructing API URLs for the http client. |
| 22 | +func (g *GraphAPIHandler) GetOAuthTokenEndpoint() string { |
| 23 | + return OAuthTokenEndpoint |
| 24 | +} |
| 25 | + |
| 26 | +// GetBearerTokenEndpoint returns the endpoint for obtaining a bearer token. Used for constructing API URLs for the http client. |
| 27 | +func (g *GraphAPIHandler) GetBearerTokenEndpoint() string { |
| 28 | + return BearerTokenEndpoint |
| 29 | +} |
| 30 | + |
| 31 | +// GetTokenRefreshEndpoint returns the endpoint for refreshing an existing token. Used for constructing API URLs for the http client. |
| 32 | +func (g *GraphAPIHandler) GetTokenRefreshEndpoint() string { |
| 33 | + return TokenRefreshEndpoint |
| 34 | +} |
| 35 | + |
| 36 | +// GetTokenInvalidateEndpoint returns the endpoint for invalidating an active token. Used for constructing API URLs for the http client. |
| 37 | +func (g *GraphAPIHandler) GetTokenInvalidateEndpoint() string { |
| 38 | + return TokenInvalidateEndpoint |
| 39 | +} |
| 40 | + |
| 41 | +// GetAPIBearerTokenAuthenticationSupportStatus returns a boolean indicating if bearer token authentication is supported in the api handler. |
| 42 | +func (g *GraphAPIHandler) GetAPIBearerTokenAuthenticationSupportStatus() bool { |
| 43 | + return BearerTokenAuthenticationSupport |
| 44 | +} |
| 45 | + |
| 46 | +// GetAPIOAuthAuthenticationSupportStatus returns a boolean indicating if OAuth authentication is supported in the api handler. |
| 47 | +func (g *GraphAPIHandler) GetAPIOAuthAuthenticationSupportStatus() bool { |
| 48 | + return OAuthAuthenticationSupport |
| 49 | +} |
| 50 | + |
| 51 | +// GetAPIOAuthWithCertAuthenticationSupportStatus returns a boolean indicating if OAuth with client certificate authentication is supported in the api handler. |
| 52 | +func (g *GraphAPIHandler) GetAPIOAuthWithCertAuthenticationSupportStatus() bool { |
| 53 | + return OAuthWithCertAuthenticationSupport |
| 54 | +} |
0 commit comments