Skip to content

Only add WSSE headers on first request #1441

Answered by larsbj
larsbj asked this question in Q&A
Discussion options

You must be logged in to vote

I ended up subclassing UsernameToken handler, with a state:

class MyUsernameToken(UsernameToken):
    def __init__(self,
                username: str,
                password: str,
                password_digest: bool=False,
                use_digest: bool=True,
                nonce: str=get_nonce(),
                created: datetime=datetime.now(timezone.utc),
                timestamp_token=None,
                zulu_timestamp=True,
                hash_password=True):
        super().__init__(username, password, password_digest, use_digest,nonce, created, timestamp_token, zulu_timestamp, hash_password)
        self.headers_applied = False

    def apply(self, envelope, headers):
 …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by larsbj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant