Skip to content

Commit 744e270

Browse files
toumorokoshiliggitt
andcommitted
Apply suggestions from code review
Co-authored-by: Jordan Liggitt <[email protected]>
1 parent 1df12ac commit 744e270

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

contributors/devel/sig-architecture/api-conventions.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -930,15 +930,17 @@ Many of the values used in an object reference are used as part of the API path.
930930
the object name is used in the path to identify the object. Unsanitized, these values can be used to
931931
attempt to retrieve other resources, such as by using values with semantic meanings such as `..` or `/`.
932932

933-
Have the controller validate the field before using it as a reference, and emit an event to
933+
Have the controller validate fields before using them as path segments in an API request, and emit an event to
934934
tell the user that the validation has failed.
935935

936-
See [Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names)
936+
See [Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/)
937937
for more information on legal object names.
938938

939939
### Do not modify the referred object
940940

941-
To minimize potential privilege escalation vectors, do not modify the object that is being referred to.
941+
To minimize potential privilege escalation vectors, do not modify the object that is being referred to,
942+
or limit modification to objects in the same namespace and constrain the type of modification allowed
943+
(for example, the HorizontalPodAutoscaler controller only writes to the `/scale` subresource).
942944

943945
### Minimize copying or printing values to the referrer object
944946

@@ -950,7 +952,7 @@ would not have access to previously.
950952

951953
The same scenario applies to writing information about the referred object to events.
952954

953-
In general, do not write or print information about the referred object to the spec, other objects, or logs.
955+
In general, do not write or print information retrieved from the referred object to the spec, other objects, or logs.
954956

955957
When it is necessary, consider whether these values would be ones that the
956958
author of the referrer object would have access to via other means (e.g. already required to

0 commit comments

Comments
 (0)