enable token review when openapi is generated

This commit is contained in:
Mike Danese 2019-07-09 13:45:41 -07:00
parent 5a7e336689
commit b9c7007ca0
2 changed files with 198 additions and 0 deletions

View File

@ -3055,6 +3055,104 @@
},
"type": "object"
},
"io.k8s.api.authentication.v1.BoundObjectReference": {
"description": "BoundObjectReference is a reference to an object that a token is bound to.",
"properties": {
"apiVersion": {
"description": "API version of the referent.",
"type": "string"
},
"kind": {
"description": "Kind of the referent. Valid kinds are 'Pod' and 'Secret'.",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
},
"uid": {
"description": "UID of the referent.",
"type": "string"
}
},
"type": "object"
},
"io.k8s.api.authentication.v1.TokenRequest": {
"description": "TokenRequest requests a token for a given service account.",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
},
"spec": {
"$ref": "#/definitions/io.k8s.api.authentication.v1.TokenRequestSpec"
},
"status": {
"$ref": "#/definitions/io.k8s.api.authentication.v1.TokenRequestStatus"
}
},
"required": [
"spec"
],
"type": "object",
"x-kubernetes-group-version-kind": [
{
"group": "authentication.k8s.io",
"kind": "TokenRequest",
"version": "v1"
}
]
},
"io.k8s.api.authentication.v1.TokenRequestSpec": {
"description": "TokenRequestSpec contains client provided parameters of a token request.",
"properties": {
"audiences": {
"description": "Audiences are the intendend audiences of the token. A recipient of a token must identitfy themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences.",
"items": {
"type": "string"
},
"type": "array"
},
"boundObjectRef": {
"$ref": "#/definitions/io.k8s.api.authentication.v1.BoundObjectReference",
"description": "BoundObjectRef is a reference to an object that the token will be bound to. The token will only be valid for as long as the bound object exists. NOTE: The API server's TokenReview endpoint will validate the BoundObjectRef, but other audiences may not. Keep ExpirationSeconds small if you want prompt revocation."
},
"expirationSeconds": {
"description": "ExpirationSeconds is the requested duration of validity of the request. The token issuer may return a token with a different validity duration so a client needs to check the 'expiration' field in a response.",
"format": "int64",
"type": "integer"
}
},
"required": [
"audiences"
],
"type": "object"
},
"io.k8s.api.authentication.v1.TokenRequestStatus": {
"description": "TokenRequestStatus is the result of a token request.",
"properties": {
"expirationTimestamp": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time",
"description": "ExpirationTimestamp is the time of expiration of the returned token."
},
"token": {
"description": "Token is the opaque bearer token.",
"type": "string"
}
},
"required": [
"token",
"expirationTimestamp"
],
"type": "object"
},
"io.k8s.api.authentication.v1.TokenReview": {
"description": "TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.",
"properties": {
@ -28243,6 +28341,104 @@
}
}
},
"/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token": {
"parameters": [
{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"in": "query",
"name": "dryRun",
"type": "string",
"uniqueItems": true
},
{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
"in": "query",
"name": "fieldManager",
"type": "string",
"uniqueItems": true
},
{
"description": "name of the TokenRequest",
"in": "path",
"name": "name",
"required": true,
"type": "string",
"uniqueItems": true
},
{
"description": "object name and auth scope, such as for teams and projects",
"in": "path",
"name": "namespace",
"required": true,
"type": "string",
"uniqueItems": true
},
{
"description": "If 'true', then the output is pretty printed.",
"in": "query",
"name": "pretty",
"type": "string",
"uniqueItems": true
}
],
"post": {
"consumes": [
"*/*"
],
"description": "create token of a ServiceAccount",
"operationId": "createCoreV1NamespacedServiceAccountToken",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.k8s.api.authentication.v1.TokenRequest"
}
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.api.authentication.v1.TokenRequest"
}
},
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/io.k8s.api.authentication.v1.TokenRequest"
}
},
"202": {
"description": "Accepted",
"schema": {
"$ref": "#/definitions/io.k8s.api.authentication.v1.TokenRequest"
}
},
"401": {
"description": "Unauthorized"
}
},
"schemes": [
"https"
],
"tags": [
"core_v1"
],
"x-kubernetes-action": "post",
"x-kubernetes-group-version-kind": {
"group": "authentication.k8s.io",
"kind": "TokenRequest",
"version": "v1"
}
}
},
"/api/v1/namespaces/{namespace}/services": {
"get": {
"consumes": [

View File

@ -69,6 +69,8 @@ kube::log::status "Starting kube-apiserver"
--cert-dir="${TMP_DIR}/certs" \
--runtime-config="api/all=true,extensions/v1beta1/daemonsets=true,extensions/v1beta1/deployments=true,extensions/v1beta1/replicasets=true,extensions/v1beta1/networkpolicies=true,extensions/v1beta1/podsecuritypolicies=true,extensions/v1beta1/replicationcontrollers=true" \
--token-auth-file="${TMP_DIR}/tokenauth.csv" \
--service-account-issuer="https://kubernetes.devault.svc/" \
--service-account-signing-key-file="${KUBE_ROOT}/staging/src/k8s.io/client-go/util/cert/testdata/dontUseThisKey.pem" \
--logtostderr \
--v=2 \
--service-cluster-ip-range="10.0.0.0/24" >"${API_LOGFILE}" 2>&1 &